automanaged

package
v0.0.10 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetLogLevel

func SetLogLevel(level log.Level)

SetLogLevel sets the log level for the logger SetLogLevel is safe to be called concurrently

Types

type AutoManagedProvider

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

func New

func New() *AutoManagedProvider

New creates a AutoManagedProvider that connects locally

func NewWithConfig

func NewWithConfig(refreshTTL time.Duration, autoManPort int, hosts ...string) *AutoManagedProvider

NewWithConfig creates an Automanaged Provider that connects to a all the hosts

func NewWithTesting

func NewWithTesting(refreshTTL time.Duration, autoManPort int, activeProvider *echo.Echo, hosts ...string) *AutoManagedProvider

NewWithTesting creates a testable provider

func (*AutoManagedProvider) DeregisterMember

func (p *AutoManagedProvider) DeregisterMember() error

DeregisterMember set the shutdown to true preventing any more TTL updates

func (*AutoManagedProvider) GetHealthStatus

func (p *AutoManagedProvider) GetHealthStatus() error

GetHealthStatus returns an error if the cluster health status has problems

func (*AutoManagedProvider) Shutdown

func (p *AutoManagedProvider) Shutdown(graceful bool) error

Shutdown set the shutdown to true preventing any more TTL updates

func (*AutoManagedProvider) StartClient

func (p *AutoManagedProvider) StartClient(cluster *cluster.Cluster) error

func (*AutoManagedProvider) StartMember

func (p *AutoManagedProvider) StartMember(cluster *cluster.Cluster) error

func (*AutoManagedProvider) UpdateClusterState

func (p *AutoManagedProvider) UpdateClusterState(state cluster.ClusterState) error

func (*AutoManagedProvider) UpdateTTL

func (p *AutoManagedProvider) UpdateTTL()

UpdateTTL sets up an endpoint to respond to other members

type NodeModel

type NodeModel struct {
	ID             string   `json:"id"`
	Address        string   `json:"address"`
	AutoManagePort int      `json:"auto_manage_port"`
	Port           int      `json:"port"`
	Kinds          []string `json:"kinds"`
	ClusterName    string   `json:"cluster_name"`
}

NodeModel represents a node in the cluster

func NewNode

func NewNode(clusterName string, address string, port int, autoManPort int, kind []string) *NodeModel

NewNode returns a new node for the cluster

Jump to

Keyboard shortcuts

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