Documentation
¶
Index ¶
- type Adapter
- type Draft
- type Entry
- 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 Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
func NewRegistry ¶
func (*Registry) Kinds ¶
func (r *Registry) Kinds() []artifactstore.SourceKind
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"`
}
Click to show internal directories.
Click to hide internal directories.