automanaged

package
v0.0.0-...-58fff37 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2020 License: Apache-2.0 Imports: 12 Imported by: 0

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 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) MonitorMemberStatusChanges

func (p *AutoManagedProvider) MonitorMemberStatusChanges()

MonitorMemberStatusChanges creates a go routine that continuously checks other members

func (*AutoManagedProvider) RegisterMember

func (p *AutoManagedProvider) RegisterMember(clusterName string, address string, port int, knownKinds []string,
	statusValue cluster.MemberStatusValue, serializer cluster.MemberStatusValueSerializer) error

func (*AutoManagedProvider) Shutdown

func (p *AutoManagedProvider) Shutdown() error

Shutdown set the shutdown to true preventing any more TTL updates

func (*AutoManagedProvider) UpdateMemberStatusValue

func (p *AutoManagedProvider) UpdateMemberStatusValue(statusValue cluster.MemberStatusValue) 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