kayak

package
v0.0.0-...-020e20f Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2022 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package kayak implements a configurable consistency consensus middleware.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Caller

type Caller interface {
	Call(method string, req interface{}, resp interface{}) error
}

Caller defines the rpc caller, supports mocks for the default rpc.PersistCaller.

type NewCallerFunc

type NewCallerFunc func(target proto.NodeID) Caller

NewCallerFunc defines the function type to return a Caller object.

type Runtime

type Runtime struct {

	/// RPC related
	// new caller functions: wrap for mocking testable purpose.
	TrackerNewCallerFunc NewCallerFunc
	WaiterNewCallerFunc  NewCallerFunc
	// contains filtered or unexported fields
}

Runtime defines the main kayak Runtime.

func NewRuntime

func NewRuntime(cfg *kt.RuntimeConfig) (rt *Runtime, err error)

NewRuntime creates new kayak Runtime.

func (*Runtime) Apply

func (r *Runtime) Apply(ctx context.Context, req interface{}) (result interface{}, logIndex uint64, err error)

Apply defines entry for Leader node.

func (*Runtime) Fetch

func (r *Runtime) Fetch(ctx context.Context, index uint64) (l *kt.Log, err error)

Fetch defines entry for missing log startFetch.

func (*Runtime) FollowerApply

func (r *Runtime) FollowerApply(l *kt.Log) (err error)

FollowerApply defines entry for follower node.

func (*Runtime) Shutdown

func (r *Runtime) Shutdown() (err error)

Shutdown waits for the Runtime to stop.

func (*Runtime) Start

func (r *Runtime) Start() (err error)

Start starts the Runtime.

func (*Runtime) UpdatePeers

func (r *Runtime) UpdatePeers(peers *proto.Peers) (err error)

UpdatePeers defines entry for peers update logic.

Directories

Path Synopsis
Package types defines required types of kayak.
Package types defines required types of kayak.
Package wal defines toy implementations of kayak wal.
Package wal defines toy implementations of kayak wal.

Jump to

Keyboard shortcuts

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