database

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2021 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	INTERNAL_ERROR         = 0
	NAMESPACE_NOT_FOUND    = 1
	ID_NOT_FOUND           = 2
	UNABLE_TO_CREATE_TABLE = 3
	FILESYSTEM_ERROR       = 4
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DbError

type DbError struct {
	ErrorCode int32
	Message   string
}

func (*DbError) Error

func (r *DbError) Error() string

type ErrorCode

type ErrorCode int32

type MemDatabase

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

func (*MemDatabase) Delete

func (mb *MemDatabase) Delete(namespace string, key string) *DbError

func (*MemDatabase) DeleteAll

func (mb *MemDatabase) DeleteAll(namespace string) *DbError

func (*MemDatabase) Get

func (mb *MemDatabase) Get(namespace string, key string) ([]byte, *DbError)

func (*MemDatabase) GetAll

func (mb *MemDatabase) GetAll(namespace string) (map[string][]byte, *DbError)

func (*MemDatabase) GetNamespaces

func (mb *MemDatabase) GetNamespaces() []string

func (*MemDatabase) Init

func (mb *MemDatabase) Init()

func (*MemDatabase) Upsert

func (mb *MemDatabase) Upsert(namespace string, key string, value []byte) *DbError

type PGDatabase

type PGDatabase struct {
	Host string
	User string
	Pass string
	// contains filtered or unexported fields
}

func (PGDatabase) Delete

func (p PGDatabase) Delete(namespace string, key string) *DbError

func (PGDatabase) DeleteAll

func (p PGDatabase) DeleteAll(namespace string) *DbError

func (PGDatabase) Get

func (p PGDatabase) Get(namespace string, key string) ([]byte, *DbError)

func (PGDatabase) GetAll

func (p PGDatabase) GetAll(namespace string) (map[string][]byte, *DbError)

func (PGDatabase) GetNamespaces

func (p PGDatabase) GetNamespaces() []string

func (*PGDatabase) Init

func (p *PGDatabase) Init()

func (PGDatabase) Upsert

func (p PGDatabase) Upsert(namespace string, key string, value []byte) *DbError

type SQLiteDatabase added in v1.3.0

type SQLiteDatabase struct {
	DirPath string
	// contains filtered or unexported fields
}

func (SQLiteDatabase) Delete added in v1.3.0

func (p SQLiteDatabase) Delete(namespace string, key string) *DbError

func (SQLiteDatabase) DeleteAll added in v1.3.0

func (p SQLiteDatabase) DeleteAll(namespace string) *DbError

func (SQLiteDatabase) Get added in v1.3.0

func (p SQLiteDatabase) Get(namespace string, key string) ([]byte, *DbError)

func (SQLiteDatabase) GetAll added in v1.3.0

func (p SQLiteDatabase) GetAll(namespace string) (map[string][]byte, *DbError)

func (SQLiteDatabase) GetNamespaces added in v1.3.0

func (p SQLiteDatabase) GetNamespaces() []string

func (*SQLiteDatabase) Init added in v1.3.0

func (p *SQLiteDatabase) Init()

func (SQLiteDatabase) Upsert added in v1.3.0

func (p SQLiteDatabase) Upsert(namespace string, key string, value []byte) *DbError

type StorageDatabase

type StorageDatabase struct {
	RootDirPath string
}

func (*StorageDatabase) Delete

func (s *StorageDatabase) Delete(namespace string, key string) *DbError

func (*StorageDatabase) DeleteAll

func (s *StorageDatabase) DeleteAll(namespace string) *DbError

func (*StorageDatabase) Get

func (s *StorageDatabase) Get(namespace string, key string) ([]byte, *DbError)

func (*StorageDatabase) GetAll

func (s *StorageDatabase) GetAll(namespace string) (map[string][]byte, *DbError)

func (*StorageDatabase) GetNamespaces

func (s *StorageDatabase) GetNamespaces() []string

func (*StorageDatabase) Init

func (s *StorageDatabase) Init()

func (*StorageDatabase) Upsert

func (s *StorageDatabase) Upsert(namespace string, key string, value []byte) *DbError

Jump to

Keyboard shortcuts

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