Documentation ¶
Index ¶
- type Handler
- type HandlerParams
- type Manager
- type RepoHandler
- func (rh *RepoHandler) DeleteManifest(ref string) (errFn error)
- func (rh *RepoHandler) DequeueEvents() []*eventv1.EventPayload
- func (rh *RepoHandler) DownloadBlob(ref string, destinationPath string) (errFn error)
- func (rh *RepoHandler) EnqueueEvent(event *eventv1.EventPayload)
- func (rh *RepoHandler) EventQueueLength() int
- func (rh *RepoHandler) EventQueueUpdate()
- func (rh *RepoHandler) GetManifestDigest(ref string) (string, error)
- func (rh *RepoHandler) PullManifest(ref string) (errFn error)
- func (rh *RepoHandler) Started() bool
- func (rh *RepoHandler) Stop()
- func (rh *RepoHandler) SyncArtifact(ctx context.Context, name string, timeout time.Duration) (chan error, func() error)
- func (rh *RepoHandler) SyncArtifactReset()
- func (rh *RepoHandler) SyncArtifactResult(name string, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Handler ¶
type Handler interface { // QueueEvent - Called when a new event is received. If store is true, the event should be stored in the database. // Note: Avoid performing any long-running operations in this function. QueueEvent(event *eventv1.EventPayload, store bool) error // Started - Returns true if the handler has started. Started() bool // Start - Called when the handler should start processing events. // This is your chance to set up any resources, e.g., database connections, run loops, etc. // This will only be called once. Start(context.Context) // Stop - Called when the handler should stop processing events and clean up resources. Stop() }
Handler - Interface for handling events for a repository.
type HandlerParams ¶
type HandlerParams struct { Dir string Bucket *blob.Bucket RemoteOptions []remote.Option NameOptions []name.Option BeskarMeta *gossip.BeskarMeta Sync config.SyncConfig // contains filtered or unexported fields }
func (HandlerParams) GetBeskarRegistryHostPort ¶ added in v0.0.21
func (hp HandlerParams) GetBeskarRegistryHostPort() string
func (HandlerParams) GetBeskarServiceHostPort ¶ added in v0.0.21
func (hp HandlerParams) GetBeskarServiceHostPort() string
func (HandlerParams) Remove ¶
func (hp HandlerParams) Remove(repository string)
type Manager ¶
type Manager[H Handler] struct { // contains filtered or unexported fields }
func NewManager ¶
func NewManager[H Handler]( params *HandlerParams, newHandler func(*slog.Logger, *RepoHandler) H, ) *Manager[H]
type RepoHandler ¶
type RepoHandler struct { Repository string Params *HandlerParams Queued chan struct{} Stopped atomic.Bool // contains filtered or unexported fields }
RepoHandler - A partial default implementation of the Handler interface that provides some common functionality. You can embed this in your own handler to get some default functionality, e.g., an event queue.
func NewRepoHandler ¶
func NewRepoHandler(repository string, params *HandlerParams, cancel context.CancelFunc) *RepoHandler
func (*RepoHandler) DeleteManifest ¶ added in v0.0.9
func (rh *RepoHandler) DeleteManifest(ref string) (errFn error)
func (*RepoHandler) DequeueEvents ¶
func (rh *RepoHandler) DequeueEvents() []*eventv1.EventPayload
func (*RepoHandler) DownloadBlob ¶
func (rh *RepoHandler) DownloadBlob(ref string, destinationPath string) (errFn error)
func (*RepoHandler) EnqueueEvent ¶
func (rh *RepoHandler) EnqueueEvent(event *eventv1.EventPayload)
func (*RepoHandler) EventQueueLength ¶
func (rh *RepoHandler) EventQueueLength() int
func (*RepoHandler) EventQueueUpdate ¶
func (rh *RepoHandler) EventQueueUpdate()
func (*RepoHandler) GetManifestDigest ¶ added in v0.0.9
func (rh *RepoHandler) GetManifestDigest(ref string) (string, error)
func (*RepoHandler) PullManifest ¶ added in v0.0.21
func (rh *RepoHandler) PullManifest(ref string) (errFn error)
func (*RepoHandler) Started ¶
func (rh *RepoHandler) Started() bool
func (*RepoHandler) Stop ¶
func (rh *RepoHandler) Stop()
func (*RepoHandler) SyncArtifact ¶ added in v0.0.18
func (*RepoHandler) SyncArtifactReset ¶ added in v0.0.18
func (rh *RepoHandler) SyncArtifactReset()
func (*RepoHandler) SyncArtifactResult ¶ added in v0.0.18
func (rh *RepoHandler) SyncArtifactResult(name string, err error)
Click to show internal directories.
Click to hide internal directories.