differentiating

package
v0.0.0-...-83e6e2d Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2020 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Image

type Image struct {
	ID       string
	Registry string
	Name     string
	Tag      string
	Auth     []*PullSecret
}

func (Image) GetNameWithRegistry

func (i Image) GetNameWithRegistry() string

func (Image) GetNameWithoutRegistry

func (i Image) GetNameWithoutRegistry() string

func (Image) GetRegistryURL

func (i Image) GetRegistryURL() string

type ListImagesRepository

type ListImagesRepository interface {
	ListImages(ctx context.Context, opts ListOptions) ([]Image, error)
}

type ListOptions

type ListOptions struct {
	ImageName string
	Registry  string
}

type MockService

type MockService struct {
	Add, Delete, Update, ListErr func(i Image) error
	List                         func(lo ListOptions) ([]Image, error)
	ListResp                     []Image
}

MockService implements the Service interface and should only be used for mocking

func (MockService) AddImage

func (ms MockService) AddImage(_ context.Context, i Image) error

AddImage implements the Service interface

func (MockService) DeleteImage

func (ms MockService) DeleteImage(_ context.Context, i Image) error

DeleteImage implements the Service interface

func (MockService) ListImages

func (ms MockService) ListImages(_ context.Context, lo ListOptions) ([]Image, error)

ListImages implements the Service interface

func (MockService) Notify

func (ms MockService) Notify(event chan<- NotificationEvent)

Notify implements the Service interface

func (MockService) UpdateImage

func (ms MockService) UpdateImage(_ context.Context, i Image) error

UpdateImage implements the Service interface

type NotificationEvent

type NotificationEvent struct {
	Image  Image
	NewTag string
}

type OCIRegistryService

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

func (*OCIRegistryService) AddImage

func (O *OCIRegistryService) AddImage(ctx context.Context, image Image) error

func (*OCIRegistryService) DeleteImage

func (O *OCIRegistryService) DeleteImage(ctx context.Context, image Image) error

func (*OCIRegistryService) ListImages

func (O *OCIRegistryService) ListImages(ctx context.Context, opts ListOptions) ([]Image, error)

func (*OCIRegistryService) Notify

func (O *OCIRegistryService) Notify(event chan<- NotificationEvent)

func (*OCIRegistryService) UpdateImage

func (O *OCIRegistryService) UpdateImage(ctx context.Context, image Image) error

type OciRegistryAPIClient

type OciRegistryAPIClient interface {
	GetTagsForImage(ctx context.Context, secret registry.OciPullSecret) ([]string, error)
}

type PullSecret

type PullSecret struct {
	Username string
	Password string
}

func (*PullSecret) GetPassword

func (p *PullSecret) GetPassword() string

func (*PullSecret) GetUsername

func (p *PullSecret) GetUsername() string

type Repository

type Repository interface {
	AddImage(ctx context.Context, image Image) error
	DeleteImage(ctx context.Context, image Image) error
	UpdateImage(ctx context.Context, image Image) error
	ListImages(ctx context.Context, opts ListOptions) ([]Image, error)
}

type Service

type Service interface {
	AddImage(ctx context.Context, image Image) error
	DeleteImage(ctx context.Context, image Image) error
	UpdateImage(ctx context.Context, image Image) error
	ListImages(ctx context.Context, opts ListOptions) ([]Image, error)
	Notify(event chan<- NotificationEvent)
}

func NewOCIRegistryService

func NewOCIRegistryService(ctx context.Context, rp Repository, workerAPIRequestSleepDuration time.Duration, initOCIAPIClientFun func(c http.Client, img registry.OciImage) OciRegistryAPIClient) Service

type Worker

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

func StartNewImageWorker

func StartNewImageWorker(ctx context.Context, client OciRegistryAPIClient, registry, imageName string, rateLimiter ratelimit.Limiter, info chan<- NotificationEvent, repository ListImagesRepository, workerAPIRequestSleepDuration time.Duration) *Worker

func (*Worker) Stop

func (w *Worker) Stop()

Jump to

Keyboard shortcuts

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