automanaged

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

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

Go to latest
Published: Aug 22, 2024 License: Apache-2.0 Imports: 11 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

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 an 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 anymore 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 anymore 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) 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, id 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