serving

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2026 License: MIT Imports: 9 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

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) Default

func (c *Catalog) Default() (State, bool)

func (*Catalog) IDs

func (c *Catalog) IDs() []string

func (*Catalog) Ready

func (c *Catalog) Ready() error

func (*Catalog) RecordFailure

func (c *Catalog) RecordFailure(id string, failure error) error

func (*Catalog) Replace

func (c *Catalog) Replace(snapshot *application.RepositorySnapshot) error

func (*Catalog) Repositories

func (c *Catalog) Repositories() []Repository

func (*Catalog) State

func (c *Catalog) State(id string) (State, bool)

func (*Catalog) States

func (c *Catalog) States() []State

type Materialization

type Materialization struct {
	Branch      string
	Commit      string
	PullRequest int
	URL         string
}

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

Jump to

Keyboard shortcuts

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