boltbrowser/models/pair.go
2022-04-20 16:22:43 -05:00

24 lines
392 B
Go

package models
import "fmt"
/*
BoltPair is just a struct representation of a Pair in the Bolt DB
*/
type BoltPair struct {
parent *BoltBucket
key string
val string
}
/*
GetPath Returns the path of the BoltPair
*/
func (p *BoltPair) GetPath() []string {
return append(p.parent.GetPath(), p.key)
}
func (p BoltPair) String() string {
return fmt.Sprintf("%s: %s", p.key, p.val)
}