store

package
v0.0.0-...-7983b3b Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

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

Store allows storing configuration in a boltdb database

func NewStore

func NewStore(path string, readWrite bool, maxBucketSize int, configBucket string) (*Store, error)

NewStore returns a new configuration store

func (*Store) Close

func (s *Store) Close() error

Close the store

func (*Store) DeleteMeta

func (s *Store) DeleteMeta(repository string, name string) error

DeleteMeta deletes a metadata

func (*Store) GetConfigs

func (s *Store) GetConfigs(product string) (configs []*pbgo.ConfigResponse, err error)

GetConfigs returns all the stored configurations for a product

func (*Store) GetLastConfig

func (s *Store) GetLastConfig(product string) (config *pbgo.ConfigResponse, err error)

GetLastConfig returns the last configuration for a product

func (*Store) GetMeta

func (s *Store) GetMeta(repository string) (map[string]json.RawMessage, error)

GetMeta returns a map of all the metadata of a repository

func (*Store) GetProducts

func (s *Store) GetProducts() ([]string, error)

GetProducts returns all the product

func (*Store) Open

func (s *Store) Open(readWrite bool) error

Open the database

func (*Store) SetMeta

func (s *Store) SetMeta(repository string, name string, meta json.RawMessage) error

SetMeta stores a metadata The meta store is unbounded but it isn't a problem as theclient always store metas with ROLE.json. We won't have an infinite number of delegations meta as we only add manually 1 by product and they don't need to be cleaned up.

func (*Store) StoreConfig

func (s *Store) StoreConfig(product string, config *pbgo.ConfigResponse) error

StoreConfig inserts a configuration into the database

Jump to

Keyboard shortcuts

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