store

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2025 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BucketEnv  = "FLOW_PROCESS_BUCKET"
	RootBucket = "root"
)

Variables

This section is empty.

Functions

func DestroyStore

func DestroyStore() error

func EnvironmentBucket

func EnvironmentBucket() string

func Path

func Path() string

Types

type BoltStore

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

func (*BoltStore) Close

func (s *BoltStore) Close() error

func (*BoltStore) CreateAndSetBucket

func (s *BoltStore) CreateAndSetBucket(id string) (string, error)

CreateAndSetBucket creates a temporary bucket for the process and returns the bucket's name

func (*BoltStore) CreateBucket

func (s *BoltStore) CreateBucket(id string) error

CreateBucket creates a bucket with a given id if it doesn't exist

func (*BoltStore) Delete

func (s *BoltStore) Delete(key string) error

Delete removes a key from the process bucket

func (*BoltStore) DeleteBucket

func (s *BoltStore) DeleteBucket(id string) error

DeleteBucket deletes a bucket by its id

func (*BoltStore) Get

func (s *BoltStore) Get(key string) (string, error)

Get retrieves a value for a key from the process bucket

func (*BoltStore) GetAll

func (s *BoltStore) GetAll() (map[string]string, error)

BucketMap returns a map of all keys and values in the process bucket

func (*BoltStore) GetKeys

func (s *BoltStore) GetKeys() ([]string, error)

Keys returns all keys in the process bucket

func (*BoltStore) Set

func (s *BoltStore) Set(key, value string) error

Set stores a key-value pair in the process bucket

type Store

type Store interface {
	CreateBucket(id string) error
	CreateAndSetBucket(id string) (string, error)
	DeleteBucket(id string) error

	Set(key, value string) error
	Get(key string) (string, error)
	GetAll() (map[string]string, error)
	GetKeys() ([]string, error)
	Delete(key string) error

	Close() error
}

func NewStore

func NewStore(dbPath string) (Store, error)

NewStore creates a new store with a given db path If dbPath is empty, it will use the default path

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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