db

package
v0.1.1-0...-0c1194d Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2019 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const UIDSize = 12

Variables

This section is empty.

Functions

func DecodeAOF

func DecodeAOF(content []byte) (uid []byte, args [][]byte, leftover []byte, err error)

func EncodeAOF

func EncodeAOF(uid []byte, args [][]byte) []byte

func GetRedisCmdHandler

func GetRedisCmdHandler(database *Database) func(conn redcon.Conn, cmd redcon.Command)

func NewRpcServer

func NewRpcServer(database *Database) *grpc.Server

Types

type AOFBus

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

func NewAOFBus

func NewAOFBus(path string, offsetSize int) (*AOFBus, error)

func (*AOFBus) Append

func (b *AOFBus) Append(args [][]byte) error

func (*AOFBus) Close

func (b *AOFBus) Close() error

func (*AOFBus) Flush

func (b *AOFBus) Flush() error

func (*AOFBus) Sync

func (b *AOFBus) Sync(ctx context.Context, writer io.Writer, offset []byte) error

type Database

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

func New

func New(options Options) (*Database, error)

func (*Database) Close

func (db *Database) Close() error

func (*Database) Daemon

func (db *Database) Daemon() error

func (*Database) Exec

func (db *Database) Exec(args [][]byte) (result *executor.Result, err error)

func (*Database) Following

func (db *Database) Following(ctx context.Context) error

func (*Database) IExec

func (db *Database) IExec(args [][]byte) (result *executor.Result, err error)

func (*Database) IsWritable

func (db *Database) IsWritable() bool

func (*Database) Record

func (db *Database) Record(cmd [][]byte) error

func (*Database) Run

func (db *Database) Run()

func (*Database) SlaveOf

func (db *Database) SlaveOf(host, port string) error

func (*Database) Sync

func (db *Database) Sync(ctx context.Context, writer io.Writer, offset []byte) error

type Node

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

func (Node) Address

func (n Node) Address() string

func (Node) String

func (n Node) String() string

type Options

type Options struct {
	DBDir string
}

type PiKVService

type PiKVService struct {
	proto.UnimplementedPiKVServer
	// contains filtered or unexported fields
}

func NewPiKVService

func NewPiKVService(database *Database) *PiKVService

func (*PiKVService) Oplog

func (s *PiKVService) Oplog(req *proto.OplogReq, srv proto.PiKV_OplogServer) error

func (*PiKVService) Snapshot

type UID

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

func NewUID

func NewUID() UID

func (UID) Bytes

func (u UID) Bytes() []byte

func (UID) Size

func (u UID) Size() int

func (UID) String

func (u UID) String() string

func (UID) Time

func (u UID) Time() time.Time

func (UID) Timestamp

func (u UID) Timestamp() string

Jump to

Keyboard shortcuts

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