index

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: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FetchRepositories

func FetchRepositories(registry *registry.Registry) (map[reference.Named]*Repository, error)

FetchRepositories fetch all repositories from a registry

Types

type Image

type Image struct {
	Tag     string            `json:"tag"`
	Created time.Time         `json:"created"`
	Labels  map[string]string `json:"labels"`
}

func FetchImage

func FetchImage(registry *registry.Registry, tag reference.NamedTagged) (*Image, error)

FetchImage fetch a single image from a repository in a registry

type Index

type Index struct {
	// contains filtered or unexported fields
}

Index contains a index of a Docker registry

func NewIndex

func NewIndex() *Index

NewIndex creates a new empty Index

func (*Index) DeleteImage

func (i *Index) DeleteImage(imageRef reference.NamedTagged)

DeleteImage deletes an image from a repository

func (*Index) Locker

func (i *Index) Locker() sync.Locker

Locker returns the read lock need to access the index thread-safely

func (*Index) MarshalJSON

func (i *Index) MarshalJSON() ([]byte, error)

MarshalJSON handles JSON serialization of an Index

func (*Index) ReplaceAllRepositories

func (i *Index) ReplaceAllRepositories(repositories map[reference.Named]*Repository)

ReplaceAllRepositories atomically replaces all repositories

func (*Index) ReplaceImage

func (i *Index) ReplaceImage(imageRef reference.NamedTagged, image *Image)

ReplaceImage atomically replaces a single image

func (*Index) ReplaceRepository

func (i *Index) ReplaceRepository(repository *Repository)

ReplaceRepository atomically replaces a single repository

func (*Index) Repositories

func (i *Index) Repositories() []reference.Named

Repositories returns a list of all the repository names

func (*Index) Repository

func (i *Index) Repository(repositoryRef reference.Named) *Repository

Repository returns a single repository

func (*Index) UnmarshalJSON

func (i *Index) UnmarshalJSON(b []byte) error

UnmarshalJSON handles JSON deserialization of an Index

type Indexer

type Indexer struct {
	// contains filtered or unexported fields
}

func NewIndexer

func NewIndexer(index *Index, actionQueueLength uint64, registries ...*registry.Registry) (*Indexer, error)

NewIndexer creates a new Indexer

func (*Indexer) ActionQueue

func (i *Indexer) ActionQueue() notifications.ActionQueue

ActionQueue returns an action queue for use by notification listeners

func (*Indexer) DeleteImage

func (i *Indexer) DeleteImage(imageRef reference.NamedTagged)

DeleteImage deletes an image from a repository

func (*Indexer) IndexAll

func (i *Indexer) IndexAll() error

IndexAll performs a complete reindexing

func (*Indexer) IndexImage

func (i *Indexer) IndexImage(imageRef reference.NamedTagged) error

IndexImage reindexes a single image

func (*Indexer) IndexRepository

func (i *Indexer) IndexRepository(repositoryRef reference.Named) error

IndexRepository performs a reindexing of a single repository

func (*Indexer) Serve

func (i *Indexer) Serve(ctx context.Context, wg *sync.WaitGroup)

Serve starts serving the action queue

type Repository

type Repository struct {
	Name   reference.Named
	Images []*Image
	// contains filtered or unexported fields
}

func FetchRepository

func FetchRepository(registry *registry.Registry, repositoryRef reference.Named) (*Repository, error)

FetchRepository fetch a whole repository from a registry

func RepositoryFromImages

func RepositoryFromImages(repositoryRef reference.Named, images ...*Image) *Repository

RepositoryFromImages creates a new Repository from a single Image

func (*Repository) DeleteImage

func (r *Repository) DeleteImage(imageRef reference.NamedTagged)

DeleteImage deletes an image from the repository

func (*Repository) GetImage

func (r *Repository) GetImage(imageRef reference.NamedTagged) *Image

GetImage gets an image by it's tag name

func (*Repository) UpdateImage

func (r *Repository) UpdateImage(image *Image)

UpdateImage adds or updates an image in the repository

type StateStorage

type StateStorage interface {
	LoadIndex() (*Index, error)
	SaveIndex(*Index) error
}

func NewStateStorage

func NewStateStorage(stateFile string, ctx context.Context) (StateStorage, error)

Jump to

Keyboard shortcuts

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