agent

package
v0.0.0-...-3f89aaf Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: GPL-3.0 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 is meant to run on every service instance setting up and connecting all the different components, that is log, server, membership and replicator.

func New

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

New creates an Agent and runs a set of methods to set up and run the agent's components.

func (*Agent) Shutdown

func (a *Agent) Shutdown() error

Shutdown ensures the agent will shut down once, even if Shutdown is called multiple times, and that it shuts down the agent components.

type Config

type Config struct {
	ServerTLSConfig *tls.Config
	PeerTLSConfig   *tls.Config
	DataDir         string
	BindAddr        string
	RPCPort         int
	NodeName        string
	StartJoinAddrs  []string
	ACLModelFile    string
	ACLPolicyFile   string
	Bootstrap       bool
}

Config comprises the config needed to set up the components managed by the agent.

func (Config) RPCAddr

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

RPCAddr extracts the RPC address from the config.

Jump to

Keyboard shortcuts

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