disk

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

Documentation

Index

Constants

View Source
const DriverName = "disk"

Variables

This section is empty.

Functions

This section is empty.

Types

type Conf

type Conf struct {
	// Directory is the path on disk where policies are stored.
	Directory string `yaml:"directory" conf:"required,example=pkg/test/testdata/store"`
	// [DEPRECATED] ScratchDir is the directory to use for holding temporary data.
	ScratchDir string `yaml:"scratchDir" conf:",ignore"`
	// WatchForChanges enables watching the directory for changes.
	WatchForChanges bool `yaml:"watchForChanges" conf:"required,example=false"`
}

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

func GetConf added in v0.15.0

func GetConf() (*Conf, error)

func (*Conf) Key

func (conf *Conf) Key() string

type Store

type Store struct {
	*storage.SubscriptionManager
	// contains filtered or unexported fields
}

func NewFromIndex

func NewFromIndex(idx index.Index) (*Store, error)

func NewFromIndexWithConf added in v0.11.0

func NewFromIndexWithConf(idx index.Index, conf *Conf) *Store

func NewStore

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

func (*Store) Close added in v0.30.0

func (s *Store) Close() error

func (*Store) Driver

func (s *Store) Driver() string

func (*Store) GetCompilationUnits

func (s *Store) GetCompilationUnits(_ context.Context, ids ...namer.ModuleID) (map[namer.ModuleID]*policy.CompilationUnit, error)

func (*Store) GetDependents

func (s *Store) GetDependents(_ context.Context, ids ...namer.ModuleID) (map[namer.ModuleID][]namer.ModuleID, error)

func (*Store) GetFirstMatch added in v0.29.0

func (s *Store) GetFirstMatch(_ context.Context, candidates []namer.ModuleID) (*policy.CompilationUnit, error)

func (*Store) InspectPolicies added in v0.35.0

func (*Store) ListPolicyIDs added in v0.12.0

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

func (*Store) ListSchemaIDs added in v0.11.0

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

func (*Store) LoadPolicy added in v0.12.0

func (s *Store) LoadPolicy(ctx context.Context, file ...string) ([]*policy.Wrapper, error)

func (*Store) LoadSchema added in v0.11.0

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

func (*Store) Reload added in v0.15.0

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

func (*Store) RepoStats added in v0.15.0

func (s *Store) RepoStats(ctx context.Context) storage.RepoStats

Jump to

Keyboard shortcuts

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