Documentation
¶
Index ¶
- type Draft
- type Mode
- type Policy
- type Reconciler
- type Reconciliation
- type Record
- type Repository
- type Service
- func (s *Service) Delete(ctx context.Context, id artifactstore.RecordID, expectedRevision uint64) error
- func (s *Service) Follow(ctx context.Context, id artifactstore.RecordID, expectedRevision uint64) (Record, error)
- func (s *Service) Get(ctx context.Context, id artifactstore.RecordID) (Record, error)
- func (s *Service) ListByRoot(ctx context.Context, rootID artifactstore.RootID) ([]Record, error)
- func (s *Service) Pin(ctx context.Context, id artifactstore.RecordID, expectedRevision uint64, ...) (Record, error)
- func (s *Service) SetEnabled(ctx context.Context, id artifactstore.RecordID, expectedRevision uint64, ...) (Record, error)
- type SourceStateUpdate
- type State
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Policy ¶
type Policy interface {
Derive(
ctx context.Context,
value root.Root,
occurrence catalog.Occurrence,
def definition.Definition,
) (Draft, bool, []artifactstore.Diagnostic)
}
type Reconciler ¶
type Reconciler struct {
// contains filtered or unexported fields
}
func NewReconciler ¶
func NewReconciler( ids artifactstore.IDGenerator, clock artifactstore.Clock, ) (*Reconciler, error)
func (*Reconciler) Reconcile ¶
func (r *Reconciler) Reconcile( ctx context.Context, rootValue root.Root, occurrences []catalog.Occurrence, existing []Record, definitions definition.Reader, policy Policy, ) (Reconciliation, error)
type Reconciliation ¶
type Reconciliation struct {
Creates []Record
Updates []SourceStateUpdate
Diagnostics []artifactstore.Diagnostic
}
type Record ¶
type Record struct {
ID artifactstore.RecordID `json:"id"`
RootID artifactstore.RootID `json:"rootID"`
Occurrence catalog.OccurrenceKey `json:"occurrence"`
Kind artifactstore.ArtifactKind `json:"kind"`
Name string `json:"name"`
Enabled bool `json:"enabled"`
Mode Mode `json:"mode"`
PinnedDefinition *artifactstore.Digest `json:"pinnedDefinition,omitempty"`
ResolvedDefinition *artifactstore.Digest `json:"resolvedDefinition,omitempty"`
Data json.RawMessage `json:"data"`
State State `json:"state"`
Diagnostics []artifactstore.Diagnostic `json:"diagnostics,omitempty"`
Revision uint64 `json:"revision"`
CreatedAt time.Time `json:"createdAt"`
ModifiedAt time.Time `json:"modifiedAt"`
}
type Repository ¶
type Repository interface {
Get(
ctx context.Context,
id artifactstore.RecordID,
) (Record, error)
ListByRoot(
ctx context.Context,
rootID artifactstore.RootID,
) ([]Record, error)
Update(
ctx context.Context,
value Record,
expectedRevision uint64,
) error
Delete(
ctx context.Context,
id artifactstore.RecordID,
expectedRevision uint64,
) error
}
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func NewService( repository Repository, definitions definition.Reader, clock artifactstore.Clock, ) (*Service, error)
func (*Service) ListByRoot ¶
type SourceStateUpdate ¶
type SourceStateUpdate struct {
RecordID artifactstore.RecordID
RootID artifactstore.RootID
ResolvedDefinition *artifactstore.Digest
State State
Diagnostics []artifactstore.Diagnostic
Revision uint64
ModifiedAt time.Time
ExpectedRevision uint64
}
SourceStateUpdate is the source-derived subset of a record update.
Refresh may update this state, but must not alter record-owned fields such as name, enabled state, mode, local data, or pinning.
func (SourceStateUpdate) Validate ¶
func (u SourceStateUpdate) Validate() error
Click to show internal directories.
Click to hide internal directories.