overlay

package
v0.35.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const DriverName = "overlay"

Variables

This section is empty.

Functions

This section is empty.

Types

type Conf

type Conf struct {
	// BaseDriver is the default storage driver
	BaseDriver string `yaml:"baseDriver" conf:"required,example=blob"`
	// FallbackDriver is the secondary or fallback storage driver
	FallbackDriver string `yaml:"fallbackDriver" conf:"required,example=disk"`
	// FallbackErrorThreshold is the max number of errors we allow within the fallbackErrorWindow period
	FallbackErrorThreshold int `yaml:"fallbackErrorThreshold,omitempty" conf:",example=5"`
	// FallbackErrorWindow is the cyclic period within which we aggregate failures
	FallbackErrorWindow time.Duration `yaml:"fallbackErrorWindow" conf:",example=5m"`
}

Conf is required (if driver is set to 'overlay') configuration for overlay storage driver. +desc=This section is required only if storage.driver is overlay.

func GetConf

func GetConf() (*Conf, error)

func (*Conf) Key

func (conf *Conf) Key() string

func (*Conf) SetDefaults

func (conf *Conf) SetDefaults()

func (*Conf) Validate

func (conf *Conf) Validate() error

type Overlay

type Overlay interface {
	// GetOverlayPolicyLoader returns a PolicyLoader implementation that wraps two SourceStores
	GetOverlayPolicyLoader(ctx context.Context, schemaMgr schema.Manager) (engine.PolicyLoader, error)
}

The interface is defined here because placing in storage causes a circular dependency, probably because it blurs the lines by implementing `SourceStore` whilst having a dependency on `schema` in order to build the compile managers in the GetOverlayPolicyLoader method.

type Store

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

func NewStore

func NewStore(ctx context.Context, conf *Conf, confW *config.Wrapper) (*Store, error)

func (*Store) Close added in v0.30.0

func (s *Store) Close() (outErr error)

func (*Store) Driver

func (s *Store) Driver() string

func (*Store) GetFirstMatch added in v0.29.0

func (s *Store) GetFirstMatch(ctx context.Context, candidates []namer.ModuleID) (*runtimev1.RunnablePolicySet, error)

func (*Store) GetOverlayPolicyLoader

func (s *Store) GetOverlayPolicyLoader(ctx context.Context, schemaMgr schema.Manager) (engine.PolicyLoader, error)

GetOverlayPolicyLoader instantiates both the base and fallback policy loaders and then returns itself.

func (*Store) InspectPolicies added in v0.35.0

func (*Store) ListPolicyIDs

func (s *Store) ListPolicyIDs(ctx context.Context, params storage.ListPolicyIDsParams) ([]string, error)

func (*Store) ListSchemaIDs

func (s *Store) ListSchemaIDs(ctx context.Context) ([]string, error)

func (*Store) LoadSchema

func (s *Store) LoadSchema(ctx context.Context, url string) (io.ReadCloser, error)

func (*Store) Reload

func (s *Store) Reload(ctx context.Context) error

Jump to

Keyboard shortcuts

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