boltbrowser/models/pair.go

21 lines
503 B
Go
Raw Normal View History

2022-04-14 16:32:39 +00:00
package models
2022-04-20 21:22:43 +00:00
import "fmt"
2022-04-14 16:32:39 +00:00
/*
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
*/
2022-04-27 22:13:05 +00:00
func (p *BoltPair) GetPath() []string { return append(p.parent.GetPath(), p.key) }
func (p *BoltPair) GetKey() string { return p.key }
func (p *BoltPair) GetValue() string { return p.val }
func (p BoltPair) String() string { return fmt.Sprintf("%s: %s", p.key, p.val) }