service

package
v0.0.0-...-5642128 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2022 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoCommunication = errors.New("no communication pathways for clients")

Functions

This section is empty.

Types

type Config

type Config struct {
	DataDir        string   // where to store raft data.
	BindAddr       string   // serf addr.
	RPCPort        int      // port for raft and client connections
	StartJoinAddrs []string // addresses to join to
	Bootstrap      bool     // should bootstrap cluster?
	NodeName       string   // raft server id

	// Enable different communications protocols for clients
	EnableHTTP bool
	EnableGRPC bool

	ServerTLS *tls.Config
	PeerTLS   *tls.Config
}

Config handles all of the customizable values for Service.

func (*Config) HTTPAddr

func (c *Config) HTTPAddr() (string, error)

HTTPAddr returns the HTTP address to the server.

func (*Config) RPCAddr

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

RPCAddr returns the host:RPCPort string

type Service

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

Service handles combining every component of the system.

func New

func New(conf Config) (*Service, error)

New returns a new service instance. This function also sets up the registry, store, mux and server fields.

func (*Service) Close

func (s *Service) Close() error

Close shuts dwon components and leaves the registry cluster.

Jump to

Keyboard shortcuts

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