broton

package module
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2022 License: Apache-2.0 Imports: 12 Imported by: 2

README

broton

GoDoc

lightweight data store which is based on Pebble.

License

Licensed under the Apache License

Authors

Copyright(c) 2020 Fred Chien fred@brobridge.com

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BytesToFloat64

func BytesToFloat64(data []byte) float64

func BytesToInt64

func BytesToInt64(data []byte) int64

func BytesToUint64

func BytesToUint64(data []byte) uint64

func Float64ToBytes

func Float64ToBytes(n float64) []byte

func Int64ToBytes

func Int64ToBytes(n int64) []byte

func StrToBytes

func StrToBytes(s string) []byte

func Uint64ToBytes

func Uint64ToBytes(n uint64) []byte

Types

type Broton

type Broton struct {
	// contains filtered or unexported fields
}

func NewBroton

func NewBroton(options *Options) (*Broton, error)

func (*Broton) Close

func (bt *Broton) Close()

func (*Broton) GetStore

func (bt *Broton) GetStore(storeName string) (*Store, error)

func (*Broton) UnregisterStore

func (bt *Broton) UnregisterStore(name string)

type ColumnFamily added in v0.0.4

type ColumnFamily struct {
	Store *Store
	Db    *pebble.DB
	Name  string
	// contains filtered or unexported fields
}

func NewColumnFamily added in v0.0.4

func NewColumnFamily(store *Store, name string) *ColumnFamily

func (*ColumnFamily) Close added in v0.0.4

func (cf *ColumnFamily) Close() error

func (*ColumnFamily) Open added in v0.0.4

func (cf *ColumnFamily) Open() error

func (*ColumnFamily) Write added in v0.0.6

func (cf *ColumnFamily) Write(key []byte, data []byte) error

type Options

type Options struct {
	DatabasePath string
}

func NewOptions

func NewOptions() *Options

type Store

type Store struct {
	// contains filtered or unexported fields
}

func NewStore

func NewStore(broton *Broton, storeName string) (*Store, error)

func (*Store) Close

func (store *Store) Close()

func (*Store) Delete

func (store *Store) Delete(column string, key []byte) error

func (*Store) GetBytes

func (store *Store) GetBytes(column string, key []byte) ([]byte, error)

func (*Store) GetColumnFamailyHandle added in v0.0.2

func (store *Store) GetColumnFamailyHandle(name string) (*ColumnFamily, error)

func (*Store) GetFloat64

func (store *Store) GetFloat64(column string, key []byte) (float64, error)

func (*Store) GetInt64

func (store *Store) GetInt64(column string, key []byte) (int64, error)

func (*Store) GetString

func (store *Store) GetString(column string, key []byte) (string, error)

func (*Store) GetUint64

func (store *Store) GetUint64(column string, key []byte) (uint64, error)

func (*Store) List added in v0.0.3

func (store *Store) List(column string, targetKey []byte, callback func(key []byte, value []byte) bool) error

func (*Store) Put

func (store *Store) Put(column string, key []byte, data []byte) error

func (*Store) PutFloat64

func (store *Store) PutFloat64(column string, key []byte, value float64) error

func (*Store) PutInt64

func (store *Store) PutInt64(column string, key []byte, value int64) error

func (*Store) PutString

func (store *Store) PutString(column string, key []byte, value string) error

func (*Store) PutUint64

func (store *Store) PutUint64(column string, key []byte, value uint64) error

func (*Store) RegisterColumns added in v0.0.2

func (store *Store) RegisterColumns(names []string) error

Jump to

Keyboard shortcuts

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