node

package
v0.1.0-alpha2 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package node provides all functionality within arrebato regarding nodes. This includes the gRPC service implementation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GRPC

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

The GRPC type is a nodesvc.NodeServiceServer implementation that handles inbound gRPC requests to get information on the node.

func NewGRPC

func NewGRPC(raft Raft, info Info, backup io.WriterTo) *GRPC

NewGRPC returns a new instance of the GRPC type that returns node information based on the Raft state.

func (*GRPC) Backup

Backup the server state, writing it to the outbound stream.

func (*GRPC) Describe

Describe the node.

func (*GRPC) Register

func (svr *GRPC) Register(registrar grpc.ServiceRegistrar, health *health.Server)

Register the GRPC service onto the grpc.ServiceRegistrar.

func (*GRPC) Watch

Watch the node state, writing data to the server stream when the leadership or known peers changes.

type Info

type Info struct {
	LocalID raft.ServerID
	Version string
}

The Info type contains node information served from the gRPC service.

type Raft

type Raft interface {
	State() raft.RaftState
	GetConfiguration() raft.ConfigurationFuture
}

The Raft interface describes types that can return information regarding the raft state.

Jump to

Keyboard shortcuts

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