fsm

package
v0.0.0-...-5c72b2d Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2021 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApplyResponse

type ApplyResponse struct {
	Error error
	Data  interface{}
}

func NewApplyErr

func NewApplyErr(err error) *ApplyResponse

type CommandPayload

type CommandPayload struct {
	Operation Operation
	Data      map[string]interface{}
}

type FSMSnapshot

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

func (*FSMSnapshot) Persist

func (f *FSMSnapshot) Persist(sink raft.SnapshotSink) error

func (*FSMSnapshot) Release

func (f *FSMSnapshot) Release()

type Operation

type Operation int
const (
	Update Operation = iota + 1
	Delete
)

type RaftFSM

type RaftFSM struct {
	ApplyCh chan *protobuf.Event
	// contains filtered or unexported fields
}

func NewRaftFSM

func NewRaftFSM(conf *config.AppConfig, logger logger.WriteLogger) (*RaftFSM, error)

func (*RaftFSM) Apply

func (f *RaftFSM) Apply(log *raft.Log) interface{}

Apply is raftコマンドの実行

func (*RaftFSM) Close

func (f *RaftFSM) Close() error

Close is 終了処理 ユーザー辞書DB、ドキュメントDBのClose

func (*RaftFSM) Restore

func (f *RaftFSM) Restore(rc io.ReadCloser) error

Restore is 未実装

func (*RaftFSM) Search

func (f *RaftFSM) Search(req *protobuf.SearchRequest) ([]byte, error)

func (*RaftFSM) Snapshot

func (f *RaftFSM) Snapshot() (raft.FSMSnapshot, error)

Snapshot is 未実装

func (*RaftFSM) Start

func (f *RaftFSM) Start() error

Jump to

Keyboard shortcuts

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