notifications

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultSubID = "registryindexer"
)

TODO: Remove hardcodings

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action struct {
	Type       ActionType
	Repository reference.Named
	Image      reference.NamedTagged
}

Action describes a desired update the index should perform

type ActionQueue

type ActionQueue chan<- Action

ActionQueue is a channel, which listeners push events to

type ActionType

type ActionType int

ActionType describes a type of update action an index can perform

const (
	IndexAllAction ActionType = iota
	IndexRepositoryAction
	IndexImageAction
	DeleteImageAction
)

Action codes indicates the type of update the index should perform

type Listener

type Listener interface {
	// Serve starts the listener as a background process until
	// the context is cancelled
	Serve(context.Context, *sync.WaitGroup)
}

Listener is an interface for Docker Registry update listeners

func NewPubSubListener

func NewPubSubListener(actionQueue ActionQueue, projectIDs []string, prefixes []string, subscriptionID string) (Listener, error)

NewPubSubListener creates a new Listener for listening to Google Pub/Sub updates

func NewWebHookLister

func NewWebHookLister(actionQueue ActionQueue, registry string, listen string) Listener

NewWebHookLister creates a new Listener for listening to webhook updates

Jump to

Keyboard shortcuts

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