store

package
v0.0.0-...-7eb9833 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Args

type Args struct {
	Name      string
	WALDir    string
	Logger    *logrus.Logger
	StoreType pb.StoreType
}

Args arguments for creating new store

type KVStore

type KVStore interface {
	Store
	Put(*pb.PutRequest) error
	Get(*pb.GetRequest) string
	InternalMap() map[string]string
}

KVStore interface for Key Value store

func NewStore

func NewStore(name string) KVStore

NewStore creates a new store

type Manager

type Manager interface {
	Create(*pb.StoreCreateRequest) error
	Delete(*pb.StoreDeleteRequest) error
	Apply(entry *pb.WalEntry) error
	Close() error
	Stores() map[string]Store
}

Manager interface for Storage management

func NewStoreManger

func NewStoreManger(logger *logrus.Logger, walDir string) Manager

NewStoreManger new instance of storage manager

type SQLStore

type SQLStore interface {
	Store
	Execute(*pb.ExecuteQueryRequest) (*pb.ExecuteQueryReply, error)
	Query(*pb.QueryRequest) (*pb.QueryReply, error)
}

SQLStore interface for Sql store

func NewSqliteStore

func NewSqliteStore(args *Args) (SQLStore, error)

NewSqliteStore creates a new store for sqlite database

type Store

type Store interface {
	Name() string
	Close() error
	Type() pb.StoreType
	Create(*pb.StoreCreateRequest)
	Delete(*pb.StoreDeleteRequest)
}

Store Interface for store

Jump to

Keyboard shortcuts

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