source

package
v0.2.20 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2026 License: MPL-2.0 Imports: 8 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          basespec.SourceID   `json:"id"`
	StorageKey  basespec.StorageKey `json:"storageKey"`
	Kind        basespec.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 added in v0.2.17

type ManagedPackageAddress struct {
	Kind    basespec.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 added in v0.2.17

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

func ParseManagedPackageAddressDirectory added in v0.2.17

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 added in v0.2.17

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 added in v0.2.17

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 added in v0.2.17

func (a ManagedPackageAddress) Validate() error

type ManagedPackageFile added in v0.2.13

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 added in v0.2.17

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 added in v0.2.13

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 added in v0.2.13

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

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

type Source

type Source struct {
	ID             basespec.SourceID   `json:"id"`
	RootID         basespec.RootID     `json:"rootID"`
	RootStorageKey basespec.StorageKey `json:"rootStorageKey"`
	StorageKey     basespec.StorageKey `json:"storageKey"`
	Kind           basespec.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 Summary

type Summary struct {
	ID             basespec.SourceID   `json:"id"`
	RootID         basespec.RootID     `json:"rootID"`
	RootStorageKey basespec.StorageKey `json:"rootStorageKey"`
	StorageKey     basespec.StorageKey `json:"storageKey"`
	Kind           basespec.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) Validate added in v0.2.13

func (s Summary) Validate() error

type Update

type Update struct {
	ExpectedRevision uint64
	DisplayName      string
	Enabled          bool

	// 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
}

Jump to

Keyboard shortcuts

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