bindings

package
v1.22.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNodeStopped = fmt.Errorf("server was stopped")

ErrNodeStopped is returned by Node.Handle() is the server was stopped.

Functions

func ConfigMultiThread

func ConfigMultiThread() error

func ConfigSingleThread

func ConfigSingleThread() error

func GenerateID

func GenerateID(address string) uint64

GenerateID generates a unique ID for a server.

Types

type Node

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

func NewNode

func NewNode(ctx context.Context, id uint64, address string, dir string) (*Node, error)

NewNode creates a new Node instance.

func (*Node) Close

func (s *Node) Close()

Close the server releasing all used resources.

func (*Node) GetBindAddress

func (s *Node) GetBindAddress() string

func (*Node) Recover

func (s *Node) Recover(cluster []protocol.NodeInfo) error

Remark that Recover doesn't take the node role into account

func (*Node) RecoverExt

func (s *Node) RecoverExt(cluster []protocol.NodeInfo) error

RecoverExt has a similar purpose as `Recover` but takes the node role into account

func (*Node) SetAutoRecovery added in v1.21.0

func (s *Node) SetAutoRecovery(on bool) error

func (*Node) SetBindAddress

func (s *Node) SetBindAddress(address string) error

func (*Node) SetDialFunc

func (s *Node) SetDialFunc(dial protocol.DialFunc) error

func (*Node) SetFailureDomain

func (s *Node) SetFailureDomain(code uint64) error

func (*Node) SetNetworkLatency

func (s *Node) SetNetworkLatency(nanoseconds uint64) error

func (*Node) SetSnapshotParams

func (s *Node) SetSnapshotParams(params SnapshotParams) error

func (*Node) Start

func (s *Node) Start() error

func (*Node) Stop

func (s *Node) Stop() error

type SnapshotParams

type SnapshotParams struct {
	Threshold uint64
	Trailing  uint64
}

Jump to

Keyboard shortcuts

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