model

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2020 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SyncModel

type SyncModel struct {
	*sb.Scuttlebutt
	// contains filtered or unexported fields
}

MemoryModel 的操作不考虑“同步” 同步由 MemoryModel 间 Stream 负责 即业务和 IO 分离

func NewSyncModel

func NewSyncModel(opts ...sb.Option) *SyncModel

func (*SyncModel) ApplyUpdates

func (s *SyncModel) ApplyUpdates(update *sb.Update) bool

func (*SyncModel) CreateReadStream added in v1.0.1

func (s *SyncModel) CreateReadStream(opts ...duplex.Option) *duplex.Duplex

func (*SyncModel) CreateSinkStream

func (s *SyncModel) CreateSinkStream(opts ...duplex.Option) *duplex.Duplex

func (*SyncModel) CreateSourceStream

func (s *SyncModel) CreateSourceStream(opts ...duplex.Option) *duplex.Duplex

func (*SyncModel) CreateStream

func (s *SyncModel) CreateStream(opts ...duplex.Option) *duplex.Duplex

func (*SyncModel) CreateWriteStream added in v1.0.1

func (s *SyncModel) CreateWriteStream(opts ...duplex.Option) *duplex.Duplex

func (*SyncModel) Get

func (s *SyncModel) Get(k string, withClock bool) interface{}

func (*SyncModel) History

func (s *SyncModel) History(peerSources sb.Sources, accept *sb.Accept) []*sb.Update

func (*SyncModel) IsAccepted added in v1.0.1

func (s *SyncModel) IsAccepted(peerAccept *sb.Accept, update *sb.Update) bool

func (*SyncModel) Keys

func (s *SyncModel) Keys() []string

func (*SyncModel) Set

func (s *SyncModel) Set(k string, v interface{}) *SyncModel

type ValueModel

type ValueModel struct {
	K string
	V interface{}
}

type ValueModelFrom

type ValueModelFrom struct {
	*ValueModel
	From sb.SourceId
}

Jump to

Keyboard shortcuts

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