Documentation
¶
Overview ¶
Package store provides utilities for storing data or state in a persistent fashion.
Index ¶
- type IStore
- type LocalStore
- func (s *LocalStore) Clear(ctx context.Context) error
- func (s *LocalStore) Close() error
- func (s *LocalStore) Create(context.Context) error
- func (s *LocalStore) Exists() bool
- func (s *LocalStore) GetElementPath(elementName string) (path string)
- func (s *LocalStore) GetFilesystem() filesystem.FS
- func (s *LocalStore) GetPath() string
- func (s *LocalStore) HasElement(elementName string) bool
- func (s *LocalStore) SetPath(path string) error
- type LocalTemporaryStore
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IStore ¶
type IStore interface { io.Closer // GetPath returns the store path GetPath() string // SetPath sets the store path SetPath(path string) error // Create sets up the store Create(ctx context.Context) error // Exists returns whether the store exists or not Exists() bool // Clear clears the store Clear(ctx context.Context) error // GetElementPath determines the path to an element in the store. GetElementPath(elementName string) (path string) // HasElement States whether elementName is in the store or not. HasElement(elementName string) bool // GetFilesystem returns the store's filesystem GetFilesystem() filesystem.FS }
func NewLocalStore ¶
NewLocalStore creates a persistent local store in the filesystem.
func NewLocalTemporaryStore ¶
func NewLocalTemporaryStore() IStore
NewLocalTemporaryStore creates a local store in the temp directory
type LocalStore ¶
type LocalStore struct {
// contains filtered or unexported fields
}
func (*LocalStore) Close ¶
func (s *LocalStore) Close() error
func (*LocalStore) Exists ¶
func (s *LocalStore) Exists() bool
func (*LocalStore) GetElementPath ¶
func (s *LocalStore) GetElementPath(elementName string) (path string)
func (*LocalStore) GetFilesystem ¶
func (s *LocalStore) GetFilesystem() filesystem.FS
func (*LocalStore) GetPath ¶
func (s *LocalStore) GetPath() string
func (*LocalStore) HasElement ¶
func (s *LocalStore) HasElement(elementName string) bool
func (*LocalStore) SetPath ¶
func (s *LocalStore) SetPath(path string) error
type LocalTemporaryStore ¶
type LocalTemporaryStore struct {
LocalStore
}
func (*LocalTemporaryStore) Close ¶
func (s *LocalTemporaryStore) Close() error
func (*LocalTemporaryStore) SetPath ¶
func (s *LocalTemporaryStore) SetPath(string) error
Click to show internal directories.
Click to hide internal directories.