database

package
v0.0.0-...-cde8871 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2024 License: GPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DbError

type DbError struct {
	ErrorCode ErrorCode
	Message   string
}

func (*DbError) Error

func (r *DbError) Error() string

type ErrorCode

type ErrorCode int32
const (
	INTERNAL_ERROR         ErrorCode = 0
	NAMESPACE_NOT_FOUND    ErrorCode = 1
	ID_NOT_FOUND           ErrorCode = 2
	UNABLE_TO_CREATE_TABLE ErrorCode = 3
	FILESYSTEM_ERROR       ErrorCode = 4
	ITEM_CONFLICT          ErrorCode = 5
)

type MemDatabase

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

func (*MemDatabase) Delete

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

func (*MemDatabase) DeleteAll

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

func (*MemDatabase) Disconnect

func (m *MemDatabase) Disconnect()

func (*MemDatabase) Get

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

func (*MemDatabase) GetAll

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

func (*MemDatabase) GetNamespaces

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

func (*MemDatabase) Init

func (m *MemDatabase) Init()

func (*MemDatabase) Upsert

func (m *MemDatabase) Upsert(namespace string, key string, value []byte, allowOverWrite bool) *DbError

type MongoDatabase

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

func (*MongoDatabase) Delete

func (m *MongoDatabase) Delete(namespace string, key string) *DbError

func (*MongoDatabase) DeleteAll

func (m *MongoDatabase) DeleteAll(namespace string) *DbError

func (*MongoDatabase) Disconnect

func (m *MongoDatabase) Disconnect()

func (*MongoDatabase) Get

func (m *MongoDatabase) Get(namespace string, key string) ([]byte, *DbError)

func (*MongoDatabase) GetAll

func (m *MongoDatabase) GetAll(namespace string) (map[string][]byte, *DbError)

func (*MongoDatabase) GetNamespaces

func (m *MongoDatabase) GetNamespaces() []string

func (*MongoDatabase) Init

func (m *MongoDatabase) Init()

func (*MongoDatabase) Upsert

func (m *MongoDatabase) Upsert(namespace string, key string, value []byte, allowOverWrite bool) *DbError

type MySqlDatabase

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

func (MySqlDatabase) Delete

func (m MySqlDatabase) Delete(namespace string, key string) *DbError

func (MySqlDatabase) DeleteAll

func (m MySqlDatabase) DeleteAll(namespace string) *DbError

func (*MySqlDatabase) Disconnect

func (m *MySqlDatabase) Disconnect()

func (MySqlDatabase) Get

func (m MySqlDatabase) Get(namespace string, key string) ([]byte, *DbError)

func (MySqlDatabase) GetAll

func (m MySqlDatabase) GetAll(namespace string) (map[string][]byte, *DbError)

func (MySqlDatabase) GetNamespaces

func (m MySqlDatabase) GetNamespaces() []string

func (*MySqlDatabase) Init

func (m *MySqlDatabase) Init()

func (MySqlDatabase) Upsert

func (m MySqlDatabase) Upsert(namespace string, key string, value []byte, allowOverWrite bool) *DbError

type PGDatabase

type PGDatabase struct {
	Host string
	Name 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) Disconnect

func (p *PGDatabase) Disconnect()

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, allowOverWrite bool) *DbError

type RedisDatabase

type RedisDatabase struct {
	Host string
	// contains filtered or unexported fields
}

func (*RedisDatabase) Delete

func (r *RedisDatabase) Delete(namespace string, key string) *DbError

func (*RedisDatabase) DeleteAll

func (r *RedisDatabase) DeleteAll(namespace string) *DbError

func (*RedisDatabase) Disconnect

func (r *RedisDatabase) Disconnect()

func (*RedisDatabase) Get

func (r *RedisDatabase) Get(namespace string, key string) ([]byte, *DbError)

func (*RedisDatabase) GetAll

func (r *RedisDatabase) GetAll(namespace string) (map[string][]byte, *DbError)

func (*RedisDatabase) GetNamespaces

func (r *RedisDatabase) GetNamespaces() []string

func (*RedisDatabase) Init

func (r *RedisDatabase) Init()

func (*RedisDatabase) Upsert

func (r *RedisDatabase) Upsert(namespace string, key string, value []byte, allowOverWrite bool) *DbError

type SQLiteDatabase

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

func (SQLiteDatabase) Delete

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

func (SQLiteDatabase) DeleteAll

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

func (*SQLiteDatabase) Disconnect

func (s *SQLiteDatabase) Disconnect()

func (SQLiteDatabase) Get

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

func (SQLiteDatabase) GetAll

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

func (SQLiteDatabase) GetNamespaces

func (p SQLiteDatabase) GetNamespaces() []string

func (*SQLiteDatabase) Init

func (s *SQLiteDatabase) Init()

func (SQLiteDatabase) Upsert

func (s SQLiteDatabase) Upsert(namespace string, key string, value []byte, allowOverWrite bool) *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) Disconnect

func (s *StorageDatabase) Disconnect()

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, allowOverWrite bool) *DbError

Jump to

Keyboard shortcuts

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