package bbolt

Import Path
	/pkg/history/bbolt (on go.dev)

Dependency Relation
	imports 15 packages, and imported by 0 packages

Involved Source Files Package bbolt provides machine history tracking and traversal using the bbolt K/V database.
Package-Level Type Names (total 3)
/* sort by: | */
BaseConfig amhist.BaseConfig Called is a list of mutation states (called ones) required to track a transition. See also CalledExclude. Optional. CalledExclude flips Called to be a blocklist. Changed is a list of transition states which had clock changes, required to track a transition. See also ChangedExclude. A state can be called, but not changed. Optional. ChangedExclude flips Changed to be a blocklist. BaseConfig.Log bool MaxRecords is the maximum number of records to keep in the history before a rotation begins. TODO StoreSchema keeps the latest machine schema and state names within [MachineRecord]. Useful for dynamic machines. StoreTransitions is a flag to store TransitionRecord, in addition to TimeRecord, for each tracked transition. TrackRejected is a flag to track rejected transitions. TrackedStates is a list of states to store clock values of. EncJson bool amount of records to save in bulk (default: 100) func NewMemory(ctx context.Context, db *bbolt.DB, mach am.Api, cfg Config, onErr func(err error)) (*Memory, error)
func (*Memory).Match(ctx context.Context, matcherFn MatcherFn) ([]*amhist.MemoryRecord, error)
BaseMemory *amhist.BaseMemory BaseMemory.Ctx context.Context BaseMemory.Mach am.Api read-only config for this history Db *bbolt.DB SaveInProgress atomic.Bool SavePending atomic.Int32 Saved atomic.Uint64 Value of Saved at the end of the last GC ActivatedBetween returns true if the state was activated within the passed human time range. ActiveBetween returns true if the state was activated all the time within the passed human time range. Config is [amhist.BaseMemory.Config]. ( Memory) Context() context.Context ( Memory) DeactivatedBetween(ctx context.Context, state string, start, end time.Time) bool Dispose is [amhist.BaseMemory.Dispose]. TODO merge with ctx FindLatest is [amhist.BaseMemory.FindLatest]. ( Memory) InactiveBetween(ctx context.Context, state string, start, end time.Time) bool Index returns the indexes of the given states in the history records, or -1 if the state is not being tracked. Index1 is [BaseMemory.Index] for a single state. IsTracked returns true if the given states are all being tracked by this memory instance. IsTracked1 is IsTracked for a single state. Machine is [amhist.BaseMemory.Machine]. MachineRecord is [amhist.BaseMemory.MachineRecord]. Match returns the first record that matches the MatcherFn. Sync is [amhist.BaseMemory.Sync]. ( Memory) ToMachineRecord(format any) (*history.MachineRecord, error) ( Memory) ToMemoryRecord(format any) (*history.MemoryRecord, error) ( Memory) ToTimeRecord(format any) (*history.TimeRecord, error) ( Memory) ToTransitionRecord(format any) (*history.TransitionRecord, error) ( Memory) ValidateQuery(query history.Query) error *Memory : github.com/pancsta/asyncmachine-go/pkg/history.MemoryApi *Memory : github.com/polarsignals/frostdb.Sync func NewMemory(ctx context.Context, db *bbolt.DB, mach am.Api, cfg Config, onErr func(err error)) (*Memory, error)
Package-Level Functions (total 7)
func Decode(v []byte, out any, tryJson bool) error
func DecTimeRecord(machId string, id uint64, v []byte, tryJson bool) (*amhist.TimeRecord, error)
GetMachine returns a machine record for a given machine id.
ListMachines returns a list of all machines in a database.
func NewDb(name string) (*bbolt.DB, error)
func NewMemory(ctx context.Context, db *bbolt.DB, mach am.Api, cfg Config, onErr func(err error)) (*Memory, error)
Package-Level Constants (total 3)
const BuckMachines = "_machines"
const BuckTimes = "times"
const BuckTransitions = "transitions"