Documentation
¶
Index ¶
- type Adapter
- type Draft
- type Entry
- type LocalPathResolver
- type LocalPathRuntime
- type Opener
- type Reader
- type Registry
- type Repository
- type Runtime
- type Service
- func (s *Service) Create(ctx context.Context, draft Draft) (Summary, error)
- func (s *Service) Delete(ctx context.Context, id artifactstore.SourceID, expectedRevision uint64) error
- func (s *Service) Get(ctx context.Context, id artifactstore.SourceID) (Summary, error)
- func (s *Service) Kinds() []artifactstore.SourceKind
- func (s *Service) List(ctx context.Context) ([]Summary, error)
- func (s *Service) Update(ctx context.Context, id artifactstore.SourceID, update Update) (Summary, error)
- type Snapshot
- type Source
- type Summary
- type Update
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Adapter ¶
type Adapter interface {
Kind() artifactstore.SourceKind
NormalizeConfig(
ctx context.Context,
raw json.RawMessage,
) (json.RawMessage, error)
Open(
ctx context.Context,
value Source,
) (Snapshot, error)
}
type Draft ¶
type Draft struct {
Kind artifactstore.SourceKind
DisplayName string
Enabled bool
Config json.RawMessage
}
type Entry ¶
type LocalPathResolver ¶ added in v0.2.11
type LocalPathResolver interface {
ResolveLocalPath(
ctx context.Context,
value Source,
locator artifactstore.Locator,
) (string, error)
}
LocalPathResolver is an optional trusted-internal capability exposed by a source adapter when a source-relative locator has a native local filesystem representation.
It is deliberately not part of Snapshot and is never exposed through public source summaries or Workspace API views. Consumers use it only after their own runtime policy has approved a selected record.
type LocalPathRuntime ¶ added in v0.2.11
type LocalPathRuntime interface {
ResolveLocalPath(
ctx context.Context,
value Source,
locator artifactstore.Locator,
) (string, error)
}
LocalPathRuntime is an optional extension implemented by the trusted source runtime when its opener supports LocalPathResolver.
It intentionally accepts a full Source rather than a public Summary because source configuration remains internal to Artifact Store consumers.
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
func NewRegistry ¶
func (*Registry) Kinds ¶
func (r *Registry) Kinds() []artifactstore.SourceKind
func (*Registry) ResolveLocalPath ¶ added in v0.2.11
func (r *Registry) ResolveLocalPath( ctx context.Context, value Source, locator artifactstore.Locator, ) (string, error)
ResolveLocalPath resolves a source-relative locator to a native absolute filesystem path when, and only when, the selected source adapter explicitly supports that capability.
This is intentionally a trusted internal capability. Public source APIs continue to expose Summary values only and never reveal source paths.
type Repository ¶
type Runtime ¶
type Runtime interface {
Get(
ctx context.Context,
id artifactstore.SourceID,
) (Source, error)
Open(
ctx context.Context,
value Source,
) (Snapshot, error)
}
Runtime is a trusted internal capability for consumers that need an operational source, including its normalized adapter configuration.
It is intentionally separate from Service, whose query methods return Summary values and do not expose opaque source configuration.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func NewService( repository Repository, registry *Registry, ids artifactstore.IDGenerator, clock artifactstore.Clock, ) (*Service, error)
func (*Service) Kinds ¶
func (s *Service) Kinds() []artifactstore.SourceKind
type Snapshot ¶
type Snapshot interface {
Generation() string
Stat(
ctx context.Context,
locator artifactstore.Locator,
) (Entry, error)
ReadDir(
ctx context.Context,
locator artifactstore.Locator,
) ([]Entry, error)
Open(
ctx context.Context,
locator artifactstore.Locator,
) (io.ReadCloser, error)
Confirm(ctx context.Context) error
Close() error
}
type Source ¶
type Source struct {
ID artifactstore.SourceID `json:"id"`
Kind artifactstore.SourceKind `json:"kind"`
DisplayName string `json:"displayName"`
Enabled bool `json:"enabled"`
Config json.RawMessage `json:"config"`
Revision uint64 `json:"revision"`
CreatedAt time.Time `json:"createdAt"`
ModifiedAt time.Time `json:"modifiedAt"`
}
type Summary ¶
type Summary struct {
ID artifactstore.SourceID `json:"id"`
Kind artifactstore.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"`
}