storage

package
v0.24.0 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2024 License: Apache-2.0 Imports: 18 Imported by: 1

Documentation

Index

Constants

View Source
const DefaultBundleCacheDir = "/var/cache/bundles"

Variables

This section is empty.

Functions

This section is empty.

Types

type HTTP

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

func NewHTTP

func NewHTTP(opts ...HTTPOption) *HTTP

func (*HTTP) Load

func (s *HTTP) Load(ctx context.Context, owner client.Object) (fs.FS, error)

type HTTPOption

type HTTPOption func(*HTTP)

func WithBearerToken

func WithBearerToken(token string) HTTPOption

func WithInsecureSkipVerify

func WithInsecureSkipVerify(v bool) HTTPOption

func WithRootCAs

func WithRootCAs(rootCAs *x509.CertPool) HTTPOption

type HTTPRequestOption

type HTTPRequestOption func(*http.Request)

type Loader

type Loader interface {
	Load(ctx context.Context, owner client.Object) (fs.FS, error)
}

type LocalDirectory

type LocalDirectory struct {
	RootDirectory string
	URL           url.URL
}

func (*LocalDirectory) Delete

func (s *LocalDirectory) Delete(_ context.Context, owner client.Object) error

func (*LocalDirectory) Load

func (s *LocalDirectory) Load(_ context.Context, owner client.Object) (fs.FS, error)

func (*LocalDirectory) ServeHTTP

func (s *LocalDirectory) ServeHTTP(resp http.ResponseWriter, req *http.Request)

func (*LocalDirectory) Store

func (s *LocalDirectory) Store(_ context.Context, owner client.Object, bundle fs.FS) error

func (*LocalDirectory) URLFor

func (s *LocalDirectory) URLFor(_ context.Context, owner client.Object) (string, error)

type Storage

type Storage interface {
	Loader
	Storer
}

func WithFallbackLoader

func WithFallbackLoader(s Storage, fallback Loader) Storage

type Storer

type Storer interface {
	Store(ctx context.Context, owner client.Object, bundle fs.FS) error
	Delete(ctx context.Context, owner client.Object) error

	http.Handler
	URLFor(ctx context.Context, owner client.Object) (string, error)
}

Jump to

Keyboard shortcuts

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