interfaces

package
v0.0.0-...-70491fa Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2017 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BgSaving func() bool
View Source
var DefualtView = "trie"
View Source
var EndIterator interface{} = &globalView
View Source
var NeedOnDel func() bool

View Callbacks

View Source
var OnAfterDelKey func(v View, key string)
View Source
var OnBeforeChanged func(s SBaseI)

Structures Callbacks

View Source
var OnBeforeDelKey func(v View, key string)
View Source
var OnFlushAll func(v View)
View Source
var StructFactory map[string]func() Structures = make(map[string]func() Structures)

工厂接口

View Source
var ViewFactory map[string]func() View = make(map[string]func() View)

工厂接口

Functions

func AppendEffectKey

func AppendEffectKey(key string)

// 操作多KEY的命令, 需要把修改过的key都加入到修改列表中

func DumpViews

func DumpViews() (s string)

func GetSeq

func GetSeq() int64

func GetUuid

func GetUuid() string

func ImproveSeq

func ImproveSeq(seq int64)

func IncSeq

func IncSeq() int64

func InitView

func InitView(v View)

func LockSeq

func LockSeq()

func RegisterStructures

func RegisterStructures(name string, f func() Structures) interface{}

func RegisterView

func RegisterView(name string, f func() View) interface{}

func SetSeq

func SetSeq(seq int64)

func SetUuid

func SetUuid(u string)

func UnlockSeq

func UnlockSeq()

Types

type BufferedConn

type BufferedConn interface {
	net.Conn
	Flush() error
}

type Marshalable

type Marshalable interface {
	Marshal() []byte
	Unmarshal([]byte) error
}

支持主从同步功能的数据结构需要实现的接口

type SBase

type SBase struct {
	Seq
	KeyRef interface{}
}

func (*SBase) GetKeyRef_AtBase

func (this *SBase) GetKeyRef_AtBase() interface{}

func (*SBase) SetKeyRef_AtBase

func (this *SBase) SetKeyRef_AtBase(v interface{})

type SBaseI

type SBaseI interface {
	SeqI
	SetKeyRef_AtBase(v interface{})
	GetKeyRef_AtBase() interface{}
}

Structure基类

type Seq

type Seq struct {
	OpSeq int64
}

func (*Seq) GetSeq

func (this *Seq) GetSeq() int64

func (*Seq) IncSeq

func (this *Seq) IncSeq() int64

func (*Seq) SetSeq

func (this *Seq) SetSeq(seq int64)

type SeqI

type SeqI interface {
	IncSeq() int64
	SetSeq(seq int64)
	GetSeq() int64
}

数据结构基类

type StreamBuffer

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

func NewStreamBuffer

func NewStreamBuffer(capacity int) *StreamBuffer

func (*StreamBuffer) Buffer

func (this *StreamBuffer) Buffer() []byte

func (*StreamBuffer) Cap

func (this *StreamBuffer) Cap() int

func (*StreamBuffer) Commit

func (this *StreamBuffer) Commit(n int)

func (*StreamBuffer) Consume

func (this *StreamBuffer) Consume(n int)

func (*StreamBuffer) ExtendCap

func (this *StreamBuffer) ExtendCap(capacity int)

func (*StreamBuffer) Len

func (this *StreamBuffer) Len() int

func (*StreamBuffer) PreReadBuffer

func (this *StreamBuffer) PreReadBuffer() []byte

func (*StreamBuffer) Reorganize

func (this *StreamBuffer) Reorganize()

func (*StreamBuffer) Tail

func (this *StreamBuffer) Tail() int

type Structures

type Structures interface {
	Name() string
}

数据结构的接口

func CreateStructures

func CreateStructures(name string) Structures

type View

type View interface {
	Name() string
	GetKey(key string) Structures
	SetKey(key string, s Structures) bool
	UpdateKey(key string, s Structures)
	DelKey(key string) bool
	FlushAll()
	GetKeyString(keyRef interface{}) (string, bool)
	Foreach(iterator interface{}, f func(key string, seq int64), n int, greaterThanSeq int64) (nextIterator interface{})
}

func CreateView

func CreateView(name string) View

func GetView

func GetView() View

Jump to

Keyboard shortcuts

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