api

package
v0.0.0-...-14b8772 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2023 License: GPL-3.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Standalone

func Standalone(image string) func(*API) error

Standalone sets the standalone image to serve requests from.

func WithAuth

func WithAuth(auth *types.AuthConfig) func(*API) error

WithAuth specify an authentication which is used to perform image pulls. This is mostly required to access to private registries or either workaround Pull rate limits

func WithCacheStore

func WithCacheStore(s string) func(*API) error

WithCacheStore sets the cache store where all container images will be stored

func WithCleanupInterval

func WithCleanupInterval(s string) func(*API) error

WithCleanupInterval sets the cleanup interval that triggers a cache cleanup The cache gets periodically cleaned up at the interval provided from the images contained in it The interval is a string and specifies a duration, e.g. 10m, 2h, 12h

func WithDNSField

func WithDNSField(s string) func(*API) error

WithDNSField sets the DNS TXT fields which containerbay will use to resolve the container image to host the website

func WithDefaultImage

func WithDefaultImage(s string) func(*API) error

WithDefaultImage sets the DefaultImage which will be used as fallback

func WithListeningAddress

func WithListeningAddress(s string) func(*API) error

WithListeningAddress sets the API listening address port in the ip:port form. To bind to all IPs, just set the port ( e.g. ":8080" )

func WithMagicDNS

func WithMagicDNS(s string) func(*API) error

WithMagicDNS sets the magic dns domain used to query the images from e.g. to allow requests like http://registry.org.image.tag.magicdns

func WithMaxSize

func WithMaxSize(s string) func(*API) error

WithMaxSize specifies a max size of the images to be served. Images bigger than the specified size are not served and an error to the client is returned Valid values are e.g. 10MB, 2GB, etc.

func WithPoolSize

func WithPoolSize(i int) func(*API) error

WithPoolSize specify a size for the queue of the worker pool

func WithWhitelist

func WithWhitelist(s ...string) func(*API) error

WithWhitelist adds a list of regexes to be whiteliste of the images that can be served. Those that doesn't match regexes are refused

func WithWorkers

func WithWorkers(i int) func(*API) error

WithWorkers specifies the number of running workers that will download images in parallel

Types

type API

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

API returns a new containerbay instance

func New

func New(opts ...Options) *API

New returns a new API instance with the given options

func (*API) Start

func (a *API) Start(opts ...EchoOption) error

Start starts the API with the given EchoOption

type EchoOption

type EchoOption func(e *echo.Echo) error

EchoOption is a generic handler which mutates the underlying Echo instance

type Options

type Options func(a *API) error

Options is a generic handler which mutates an API object

Jump to

Keyboard shortcuts

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