bboltstore

package
v1.6.2 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2024 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EventTypeUnknown   = EventType(iota)
	EventTypeOpCreated = EventType(iota)
	EventTypeOpUpdated = EventType(iota)
)

Variables

View Source
var (
	SystemBucket        = []byte("oplog.system")       // system stores metadata
	OpLogBucket         = []byte("oplog.log")          // oplog stores existant operations.
	RepoIndexBucket     = []byte("oplog.repo_idx")     // repo_index tracks IDs of operations affecting a given repo
	PlanIndexBucket     = []byte("oplog.plan_idx")     // plan_index tracks IDs of operations affecting a given plan
	FlowIdIndexBucket   = []byte("oplog.flow_id_idx")  // flow_id_index tracks IDs of operations affecting a given flow
	InstanceIndexBucket = []byte("oplog.instance_idx") // instance_id_index tracks IDs of operations affecting a given instance
	SnapshotIndexBucket = []byte("oplog.snapshot_idx") // snapshot_index tracks IDs of operations affecting a given snapshot
)

Functions

This section is empty.

Types

type BboltStore

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

OpLog represents a log of operations performed. Operations are indexed by repo and plan.

func NewBboltStore

func NewBboltStore(databasePath string) (*BboltStore, error)

func (*BboltStore) Add

func (o *BboltStore) Add(ops ...*v1.Operation) error

Add adds a generic operation to the operation log.

func (*BboltStore) Close

func (o *BboltStore) Close() error

func (*BboltStore) Delete

func (o *BboltStore) Delete(ids ...int64) ([]*v1.Operation, error)

func (*BboltStore) Get

func (o *BboltStore) Get(id int64) (*v1.Operation, error)

func (*BboltStore) Query

func (o *BboltStore) Query(q oplog.Query, f func(*v1.Operation) error) error

func (*BboltStore) ResetForTest

func (o *BboltStore) ResetForTest(t *testing.T)

func (*BboltStore) SetVersion

func (o *BboltStore) SetVersion(version int64) error

func (*BboltStore) Transform

func (o *BboltStore) Transform(q oplog.Query, f func(*v1.Operation) (*v1.Operation, error)) error

func (*BboltStore) Update

func (o *BboltStore) Update(ops ...*v1.Operation) error

func (*BboltStore) Version

func (o *BboltStore) Version() (int64, error)

type EventType

type EventType int

type Query

type Query struct {
	RepoId     string
	PlanId     string
	SnapshotId string
	FlowId     int64
	InstanceId string
	Ids        []int64
}

Query represents a query to the operation log.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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