node

package
v0.0.0-...-f5d25ad Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2020 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package node implements a raft node that can communicate with other nodes.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Node

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

Node is a database node.

m := node.New(log)
err := m.ListenAndServe(ctx, ":34213")

func New

func New(log zerolog.Logger) *Node

New creates a new node that is executing commands on the given executor.

func (*Node) ListenAndServe

func (m *Node) ListenAndServe(ctx context.Context, addr string) error

ListenAndServe starts the node on the given address. The given context must be used to stop the server, since there is no stop function. Canceling the context or a context timeout will cause the server to attempt a graceful shutdown.

Jump to

Keyboard shortcuts

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