database

package
v0.0.0-...-be9e185 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrDataUpdateNotAllow = errDataUpdateNotAllow()
View Source
var ErrDatabaseNotFound = errDatabaseNotFound()

Functions

func GetData

func GetData(callback func([]byte), id string, buckets ...string) func(*bbolt.Tx) error

func Last

func Last(callback func([]byte), prefixID []byte, buckets ...string) func(*bbolt.Tx) error

func List

func List(callback func(data map[string][]byte)) func(*bbolt.Tx) error

func ListKeys

func ListKeys(callback func(list [][]byte), buckets ...string) func(*bbolt.Tx) error

func PersistData

func PersistData(id string, data []byte, update bool, buckets ...string) func(*bbolt.Tx) error

func QueryData

func QueryData(ctx context.Context, callback func(data *QueryType), prefixID []byte, reverse bool, buckets ...string) func(*bbolt.Tx) error

func RemoveData

func RemoveData(id string, buckets ...string) func(*bbolt.Tx) error

Types

type DB

type DB interface {
	PID() *actor.PID
	RootContext() *actor.RootContext
}

func Open

func Open(ctx actor.Context, pathdb string) (DB, error)

type DBservice

type DBservice interface {
	Insert(id string, data []byte, buckets ...string) (string, error)
	Update(id string, data []byte, buckets ...string) (string, error)
	Get(id string, buckets ...string) ([]byte, error)
	Delete(id string, buckets ...string) error
	Query(prefixID string, reverse bool, query func(data []byte) bool, buckets ...string) error
	List() (map[string][]byte, error)
	ListKeys(buckets ...string) ([][]byte, error)
}

func NewService

func NewService(db DB) DBservice

type MsgAckDeleteData

type MsgAckDeleteData struct {
	Buckets []string
	ID      string
}

type MsgAckGetData

type MsgAckGetData struct {
	Data []byte
}

type MsgAckList

type MsgAckList struct {
	Data map[string][]byte
}

type MsgAckListKeys

type MsgAckListKeys struct {
	Data [][]byte
}

type MsgAckPersistData

type MsgAckPersistData struct {
	Bucktes []string
	ID      string
}

type MsgCloseDB

type MsgCloseDB struct{}

type MsgDeleteData

type MsgDeleteData struct {
	ID      string
	Buckets []string
}

type MsgErrorDB

type MsgErrorDB struct{}

type MsgFlushFilesystem

type MsgFlushFilesystem struct{}

type MsgGetData

type MsgGetData struct {
	Buckets []string
	ID      string
}

type MsgInsertData

type MsgInsertData struct {
	ID      string
	Data    []byte
	Buckets []string
}

type MsgList

type MsgList struct {
}

type MsgListKeys

type MsgListKeys struct {
	Buckets []string
}

type MsgNoAckDeleteData

type MsgNoAckDeleteData struct {
	Error string
}

type MsgNoAckGetData

type MsgNoAckGetData struct {
	Error string
}

type MsgNoAckList

type MsgNoAckList struct {
	Error string
}

type MsgNoAckListKyes

type MsgNoAckListKyes struct {
	Error string
}

type MsgNoAckPersistData

type MsgNoAckPersistData struct {
	Error string
}

type MsgOpenDB

type MsgOpenDB struct{}

type MsgOpenedDB

type MsgOpenedDB struct{}

type MsgQueryData

type MsgQueryData struct {
	Buckets  []string
	PrefixID string
	Reverse  bool
}

type MsgQueryNext

type MsgQueryNext struct{}

type MsgQueryResponse

type MsgQueryResponse struct {
	ID      string
	Buckets []string
	Data    []byte
}

type MsgUpdateData

type MsgUpdateData struct {
	ID      string
	Data    []byte
	Buckets []string
}

type QueryType

type QueryType struct {
	Data []byte
	ID   string
}

Jump to

Keyboard shortcuts

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