storage

package
v0.0.0-...-76cb802 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2021 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// TableCruxData table name of crux data
	TableCruxData = "crux_data"
)

Variables

This section is empty.

Functions

func InitLevelDb

func InitLevelDb(dbPath string) (*levelDb, error)

func InitMysql

func InitMysql(dbPath string) (*sqlDB, error)

InitMysql .

Types

type CruxData

type CruxData struct {
	Key   []byte `gorm:"type:blob NOT NULL;" json:"key"`
	Value []byte `gorm:"type:blob NOT NULL;" json:"value"`
}

CruxData .

type DataStore

type DataStore interface {
	Write(key *[]byte, value *[]byte) error
	Read(key *[]byte) (*[]byte, error)
	ReadAll(f func(key, value *[]byte)) error
	Delete(key *[]byte) error
	Close() error
}

DataStore is an interface that facilitates operations with an underlying persistent data store.

Jump to

Keyboard shortcuts

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