agent

package
v0.10.11 Latest Latest
Warning

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

Go to latest
Published: May 23, 2022 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Agent

type Agent struct {
	Config
	// contains filtered or unexported fields
}

Agent orchestrates the different components of our commit log service. It runs on every instance of our service.

func New

func New(config Config) (*Agent, error)

Constructs a new Agent instance. It take the following steps for setting up an Agent: Setup application logging, created data-structures for the commit log, setup the RPC server and finally start the cluster membership manager. Returns any error which occurs during the membership setup, nil otherwise.

func (*Agent) Shutdown

func (a *Agent) Shutdown() error

Shuts down the commit log service agent. The following steps are taken: Leave Cluster, Stop record replication, gracefully stop RPC server, cleanup data structures for the commit log. This method retains the files written by the log service since they might be necessary for data recovery. Returns any error which occurs during the shutdown process, nil otherwise.

type Config

type Config struct {
	ServerTLSConfig *tls.Config // TLS authentication config for server
	PeerTLSConfig   *tls.Config // TLS authentication config for peers

	DataDir string // Data directory for storing log records

	BindAddr       string   // Address of socket used for listening to cluster membership events
	RPCPort        int      // Port used for serving log service GRPC requests
	NodeName       string   // Node name to use for cluster membership
	StartJoinAddrs []string // Addresses of nodes from the cluster. Used for joining the cluster

	Bootstrap bool // Set on leader to bootstrap Raft cluster.

	ACLModelFile  string // Access control list model file for authorization
	ACLPolicyFile string // Access control list policy file for authorization
}

Represents the configuration for our Agent.

func (Config) RPCAddr

func (c Config) RPCAddr() (string, error)

RPC Socket Address with format "{BindAddrHost}:{RPCPort}" BindAddr and RPCAddr share the same host.

Jump to

Keyboard shortcuts

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