Documentation ¶
Index ¶
- Variables
- func Open(path string) (*bbolt.DB, error)
- func TypeToString(fieldType boltz.FieldType) string
- type Entry
- type State
- func (state *State) AtRoot() bool
- func (state *State) Back() error
- func (state *State) BucketStats() bbolt.BucketStats
- func (state *State) CurrentBucket(tx *bbolt.Tx) *bbolt.Bucket
- func (state *State) CurrentBucketKeyCount() int64
- func (state *State) CurrentBucketKeyCountInTx(tx *bbolt.Tx) int64
- func (state *State) DbStats() bbolt.Stats
- func (state *State) Done()
- func (state *State) Enter(name string) error
- func (state *State) GetValue(key string) string
- func (state *State) ListEntries() []Entry
Constants ¶
This section is empty.
Variables ¶
var Branch = ""
var BuildDate = ""
var Commit = ""
var Version = "v0.0.0-dev"
Functions ¶
func TypeToString ¶
TypeToString will convert boltz types to string values. If an unknown type is encountered, "unknown" is returned.
Types ¶
type Entry ¶
type Entry struct { Name string Type boltz.FieldType TypeString string Value []byte ValueString *string }
Entry is a struct that represents a value field from the bbolt database with the key being set to the Name property. Type information and string representations of the value are also provided.
type State ¶
type State struct { DB *bbolt.DB Path []string History []string // contains filtered or unexported fields }
func NewState ¶
NewState creates a State which will attempt to open path as a bbolt database. If the path or db are invalid nil and an error are returned. Otherwise, a newly initialized State is returned at the root of the database.
func (*State) BucketStats ¶
func (state *State) BucketStats() bbolt.BucketStats
BucketStats returns the bbolt.BucketStats for the bucket the state's path currently points to
func (*State) CurrentBucket ¶
CurrentBucket will return a *bbolt.Bucket matching the current state.path.
func (*State) CurrentBucketKeyCount ¶
CurrentBucketKeyCount returns the number of keys in the bucket the state's path currently points to.
func (*State) CurrentBucketKeyCountInTx ¶
CurrentBucketKeyCountInTx does the same thing as CurrentBucketKeyCount but withing an existing transaction
func (*State) Done ¶
func (state *State) Done()
Done is meant to be called when the state is no longer needed.
func (*State) GetValue ¶
GetValue returns the string value for a specific key in the current state's path location
func (*State) ListEntries ¶
ListEntries returns an array of all Entries for the current bucket