Documentation
¶
Index ¶
- type Catalog
- func (c *Catalog) Default() (State, bool)
- func (c *Catalog) IDs() []string
- func (c *Catalog) Ready() error
- func (c *Catalog) RecordFailure(id string, failure error) error
- func (c *Catalog) Replace(snapshot *application.RepositorySnapshot) error
- func (c *Catalog) Repositories() []Repository
- func (c *Catalog) State(id string) (State, bool)
- func (c *Catalog) States() []State
- type Materialization
- type Materializer
- type Repository
- type SnapshotSource
- type State
- type Synchronizer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Catalog ¶
type Catalog struct {
// contains filtered or unexported fields
}
Catalog owns the active snapshot for every configured repository.
func NewCatalog ¶
func NewCatalog(repositories []Repository) (*Catalog, error)
func (*Catalog) Replace ¶
func (c *Catalog) Replace(snapshot *application.RepositorySnapshot) error
func (*Catalog) Repositories ¶
func (c *Catalog) Repositories() []Repository
type Materialization ¶
type Materializer ¶
type Materializer interface {
Materialize(context.Context, Repository, string, store.Annotation) (Materialization, error)
}
type Repository ¶
type Repository struct {
Identity application.RepositoryIdentity
Provider string
Remote string
Branch string
Default bool
}
Repository identifies one remote repository served by koment.
func (Repository) Validate ¶
func (r Repository) Validate() error
type SnapshotSource ¶
type SnapshotSource interface {
Snapshot(context.Context, Repository) (*application.RepositorySnapshot, error)
}
SnapshotSource builds one immutable snapshot from a provider commit.
type State ¶
type State struct {
Repository Repository
Snapshot *application.RepositorySnapshot
LastAttempt time.Time
LastSuccess time.Time
Failure string
}
State is the current immutable snapshot and synchronization status.
type Synchronizer ¶
type Synchronizer struct {
Catalog *Catalog
Source SnapshotSource
}
Synchronizer refreshes configured repositories outside request handling.
func (Synchronizer) Refresh ¶
func (s Synchronizer) Refresh(ctx context.Context, repository Repository) error
func (Synchronizer) RefreshAll ¶
func (s Synchronizer) RefreshAll(ctx context.Context) error