source

package
v0.2.21 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 9, 2026 License: MPL-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Draft

type Draft struct {
	ID          SourceID            `json:"id"`
	StorageKey  basespec.StorageKey `json:"storageKey"`
	Kind        SourceKind          `json:"kind"`
	DisplayName string              `json:"displayName"`
	Enabled     bool                `json:"enabled"`
	Config      json.RawMessage     `json:"config"`
}

type Entry

type Entry struct {
	Locator    basespec.Locator
	Name       string
	SizeBytes  int64
	Mode       uint32
	ModifiedAt time.Time

	IsDirectory bool
	IsRegular   bool
}

func (Entry) Validate

func (e Entry) Validate() error

type ManagedPackageAddress

type ManagedPackageAddress struct {
	Kind    PackageKind             `json:"kind"`
	Name    basespec.LogicalName    `json:"name"`
	Version basespec.LogicalVersion `json:"version"`
}

ManagedPackageAddress is the generic semantic address of one complete managed package.

Artifact Store owns only this three-segment address shape:

<kind>/<name>/<version>

Artifact families own the values of Kind, Name, Version, all primary file names, and all package-relative resource conventions.

func NewManagedPackageAddress

func NewManagedPackageAddress(
	kind PackageKind,
	name basespec.LogicalName,
	version basespec.LogicalVersion,
) (ManagedPackageAddress, error)

func ParseManagedPackageAddressDirectory

func ParseManagedPackageAddressDirectory(
	directory basespec.Locator,
) (ManagedPackageAddress, error)

ParseManagedPackageAddressDirectory decodes an address previously derived through Directory. It accepts no extra namespace or implementation segments.

func (ManagedPackageAddress) Directory

func (a ManagedPackageAddress) Directory() (basespec.Locator, error)

Directory returns the source-relative directory used by MapStore and normal filesystem users. It is derived from semantic package identity and never caller-supplied as an arbitrary directory.

func (ManagedPackageAddress) FileLocator

func (a ManagedPackageAddress) FileLocator(
	relative basespec.Locator,
) (basespec.Locator, error)

FileLocator returns a source-relative locator for one package-relative regular file.

func (ManagedPackageAddress) Validate

func (a ManagedPackageAddress) Validate() error

type ManagedPackageFile

type ManagedPackageFile struct {
	Locator basespec.Locator `json:"locator"`
	Content []byte           `json:"content"`
}

ManagedPackageFile is one regular file relative to a managed package root. Empty directories are deliberately not represented.

func NormalizeManagedPackageFiles

func NormalizeManagedPackageFiles(
	input []ManagedPackageFile,
) ([]ManagedPackageFile, error)

NormalizeManagedPackageFiles validates and returns an independently owned, deterministic package file set. It is separate from package addressing so a caller can validate package contents before it has derived the final semantic package address.

type ManagedPackagePublication

type ManagedPackagePublication struct {
	Address            ManagedPackageAddress `json:"address"`
	ExpectedGeneration string                `json:"expectedGeneration,omitempty"`
	Files              []ManagedPackageFile  `json:"files"`
}

ManagedPackagePublication atomically publishes one package at one semantic address. ExpectedGeneration is optional for creation and required by callers that intentionally replace existing package content.

func NormalizeManagedPackagePublication

func NormalizeManagedPackagePublication(
	input ManagedPackagePublication,
) (ManagedPackagePublication, error)

NormalizeManagedPackagePublication validates both the semantic address and package files and returns fully owned deterministic data.

type PackageKind

type PackageKind string

func (PackageKind) Validate

func (v PackageKind) Validate() error

type Source

type Source struct {
	ID             SourceID            `json:"id"`
	RootID         root.RootID         `json:"rootID"`
	RootStorageKey basespec.StorageKey `json:"rootStorageKey"`
	StorageKey     basespec.StorageKey `json:"storageKey"`
	Kind           SourceKind          `json:"kind"`
	DisplayName    string              `json:"displayName"`
	Enabled        bool                `json:"enabled"`
	Config         json.RawMessage     `json:"-"`

	Revision   uint64     `json:"revision"`
	CreatedAt  time.Time  `json:"createdAt"`
	ModifiedAt time.Time  `json:"modifiedAt"`
	RetiredAt  *time.Time `json:"retiredAt,omitempty"`
}

func (Source) Clone

func (s Source) Clone() Source

func (Source) Summary

func (s Source) Summary() Summary

func (Source) Validate

func (s Source) Validate() error

type SourceID

type SourceID string

func (SourceID) Validate

func (v SourceID) Validate() error

type SourceKind

type SourceKind string
const (
	SourceKindFilesystemDirectory SourceKind = "fs-directory"
	SourceKindEmbeddedDirectory   SourceKind = "embedded-directory"
	SourceKindManagedDirectory    SourceKind = "managed-directory"
)

func (SourceKind) Validate

func (v SourceKind) Validate() error

type Summary

type Summary struct {
	ID             SourceID            `json:"id"`
	RootID         root.RootID         `json:"rootID"`
	RootStorageKey basespec.StorageKey `json:"rootStorageKey"`
	StorageKey     basespec.StorageKey `json:"storageKey"`
	Kind           SourceKind          `json:"kind"`
	DisplayName    string              `json:"displayName"`
	Enabled        bool                `json:"enabled"`
	Revision       uint64              `json:"revision"`
	CreatedAt      time.Time           `json:"createdAt"`
	ModifiedAt     time.Time           `json:"modifiedAt"`
	RetiredAt      *time.Time          `json:"retiredAt,omitempty"`
}

func (Summary) Clone

func (s Summary) Clone() Summary

func (Summary) Validate

func (s Summary) Validate() error

type Update

type Update struct {
	ExpectedRevision uint64 `json:"expectedRevision" required:"true"`
	DisplayName      string `json:"displayName"      required:"true"`
	Enabled          bool   `json:"enabled"`

	// Config is write-only replacement configuration. A nil value preserves
	// the current normalized configuration so public callers can update Source
	// metadata without reading or resending private Source configuration.
	Config json.RawMessage `json:"config,omitempty"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL