pointerdb

package
v0.8.5 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2019 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// BoltPointerBucket is the string representing the bucket used for `PointerEntries` in BoltDB
	BoltPointerBucket = "pointers"
)

Variables

View Source
var Error = errs.Class("pointerdb error")

Error is the default boltdb errs class

Functions

func NewStore

func NewStore(dbURLString string) (db storage.KeyValueStore, err error)

NewStore returns database for storing pointer data

Types

type Config

type Config struct {
	DatabaseURL          string      `help:"the database connection string to use" default:"bolt://$CONFDIR/pointerdb.db"`
	MinRemoteSegmentSize memory.Size `default:"1240" help:"minimum remote segment size"`
	MaxInlineSegmentSize memory.Size `default:"8000" help:"maximum inline segment size"`
	Overlay              bool        `default:"true" help:"toggle flag if overlay is enabled"`
	BwExpiration         int         `default:"45"   help:"lifespan of bandwidth agreements in days"`
}

Config is a configuration struct that is everything you need to start a PointerDB responsibility

type Service

type Service struct {
	DB storage.KeyValueStore
	// contains filtered or unexported fields
}

Service structure

func NewService

func NewService(logger *zap.Logger, db storage.KeyValueStore) *Service

NewService creates new pointerdb service

func (*Service) Delete

func (s *Service) Delete(path string) (err error)

Delete deletes from item from db

func (*Service) Get

func (s *Service) Get(path string) (pointer *pb.Pointer, err error)

Get gets pointer from db

func (*Service) Iterate

func (s *Service) Iterate(prefix string, first string, recurse bool, reverse bool, f func(it storage.Iterator) error) (err error)

Iterate iterates over items in db

func (*Service) List

func (s *Service) List(prefix string, startAfter string, endBefore string, recursive bool, limit int32,
	metaFlags uint32) (items []*pb.ListResponse_Item, more bool, err error)

List returns all Path keys in the pointers bucket

func (*Service) Put

func (s *Service) Put(path string, pointer *pb.Pointer) (err error)

Put puts pointer to db under specific path

Jump to

Keyboard shortcuts

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