storage

package
v0.0.0-...-55c0a6c Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2021 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	METABUCKET_TYPES                      = "typebucket"
	MAXSEARCHVALUESIZE                    = 1024 * 1024 * 8
	METADESC_FILED                        = "description"
	METAFILEDS_FIELD                      = "fields"
	METAQUEUESIZE                         = 128
	METAOPP_CREATE     MetaOpperationType = iota
	METAOPP_DELETE
	METAOPP_UPDATE
	METAOPP_FIELDLIST
	METAOPP_ADDSEARCHVALUE
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AddSearchValue

type AddSearchValue interface {
	TypeName() []byte
	FieldName() []byte
	Value() []byte
	Owner() []byte
}

type Document

type Document struct {
	Key     []byte
	Payload StorableType
}

type MetaOpperation

type MetaOpperation struct {
	Opp     MetaOpperationType
	Payload StorableType
}

type MetaOpperationType

type MetaOpperationType uint8

type MetaResponse

type MetaResponse struct {
	Payload []byte
}

type Query

type Query struct {
	Bucket  string
	Type    QueryType
	Content *Document
}

type QueryType

type QueryType uint8
const (
	QUERYTYPE_READ QueryType = iota
	QUERYTYPE_WRITE
	QUERYTYPE_ADD
	QUERYTYPE_DELETE
	MINBUCKETNAME_SIZE = 1
	MINKEY_SIZE        = 32
)

type Response

type Response struct {
	Error error
	Data  []byte
	Key   []byte
}

type StorableType

type StorableType interface {
	Name() []byte
	Serialize() []byte
	Fields() []string
}

type Store

type Store struct {
	Db   *bolt.DB
	Meta *bolt.DB
	// contains filtered or unexported fields
}

func NewStore

func NewStore(p *StoreParameter) (*Store, error)

func (*Store) Close

func (s *Store) Close()

type StoreParameter

type StoreParameter struct {
	DbFilePath string
	Timeout    time.Duration
	Mode       os.FileMode
}

Jump to

Keyboard shortcuts

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