sstore

package module
v0.0.0-...-1136d08 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2021 License: MIT Imports: 18 Imported by: 0

README

sstore

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeGobber

func DeGobber(in []byte, target interface{}) error

func Gobber

func Gobber(i interface{}) []byte

func SortKeys

func SortKeys(in []*Key)

Types

type Key

type Key struct {
	Bucket  string
	ID      string
	Version uint64
}

func ParseKeyString

func ParseKeyString(key string) *Key

func (*Key) BucketBytes

func (k *Key) BucketBytes() []byte

func (*Key) Bytes

func (k *Key) Bytes() (bucket []byte, key []byte)

func (*Key) Copy

func (k *Key) Copy() *Key

func (*Key) IsAfter

func (k *Key) IsAfter(key *Key) bool

func (*Key) IsVersioned

func (k *Key) IsVersioned() bool

func (*Key) KeyBytes

func (k *Key) KeyBytes() []byte

func (*Key) String

func (k *Key) String() string

type RPC

type RPC struct {
	pb.UnimplementedSStoreRPCServer
	// contains filtered or unexported fields
}

func (*RPC) Delete

func (r *RPC) Delete(ctx context.Context, in *pb.Key) (*pb.Empty, error)

func (*RPC) Get

func (r *RPC) Get(ctx context.Context, in *pb.Key) (*pb.Object, error)

func (*RPC) GetNewKey

func (r *RPC) GetNewKey(ctx context.Context, in *pb.Bucket) (*pb.Key, error)

func (*RPC) ListBuckets

func (r *RPC) ListBuckets(in *pb.Empty,
	stream pb.SStoreRPC_ListBucketsServer) error

func (*RPC) ListKeys

func (r *RPC) ListKeys(in *pb.Bucket,
	stream pb.SStoreRPC_ListKeysServer) error

func (*RPC) Put

func (r *RPC) Put(ctx context.Context, in *pb.Object) (*pb.Key, error)

func (*RPC) Search

func (r *RPC) Search(in *pb.Key, stream pb.SStoreRPC_SearchServer) error

func (*RPC) Version

func (r *RPC) Version(ctx context.Context, in *pb.Key) (*pb.Key, error)

type SStoreClient

type SStoreClient struct {
	Address string
	Options []grpc.DialOption
	Conn    *grpc.ClientConn
	Client  pb.SStoreRPCClient
}

func (*SStoreClient) Close

func (ss *SStoreClient) Close()

func (*SStoreClient) Connect

func (ss *SStoreClient) Connect(addr string, opts ...grpc.DialOption)

func (*SStoreClient) Delete

func (ss *SStoreClient) Delete(key *Key) error

func (*SStoreClient) Get

func (ss *SStoreClient) Get(key *Key, obj Storable) error

func (*SStoreClient) ListBuckets

func (ss *SStoreClient) ListBuckets() ([]string, error)

func (*SStoreClient) ListKeys

func (ss *SStoreClient) ListKeys(bucket string) ([]*Key, error)

func (*SStoreClient) NewKey

func (ss *SStoreClient) NewKey(bucket string) (*Key, error)

func (*SStoreClient) Put

func (ss *SStoreClient) Put(key *Key, obj Storable) (*Key, error)

func (*SStoreClient) Search

func (ss *SStoreClient) Search(bucket, prefix string) ([]*Key, error)

func (*SStoreClient) Version

func (ss *SStoreClient) Version(key *Key) (uint64, error)

type SStoreServer

type SStoreServer struct {
	Address string
	Opts    []grpc.ServerOption
	GServer *grpc.Server
	// contains filtered or unexported fields
}

func NewSStoreServer

func NewSStoreServer(dpath, dname string,
	opts ...grpc.ServerOption) *SStoreServer

func (*SStoreServer) Serve

func (ss *SStoreServer) Serve(address string)

type Storable

type Storable interface {
	Encode() []byte
	Decode([]byte) error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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