node

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2017 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NodeIDFileName    = "/ID"
	JoinRetryInterval = 5
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Node

type Node struct {
	ID string

	RaftID uint64

	WasJoin bool
	// contains filtered or unexported fields
}

func NewNode

func NewNode(config config.SwanConfig) (*Node, error)

func (*Node) JoinAsAgent

func (n *Node) JoinAsAgent(nodeInfo types.Node) error

func (*Node) JoinAsManager

func (n *Node) JoinAsManager(nodeInfo types.Node) ([]types.Node, error)

func (*Node) Start

func (n *Node) Start(ctx context.Context) error

node start from here - 1, start manager if needed - 2, start agent if needed - 3, agent join to managers if needed - 4, start the API server, both for agent and client - 5, enter loop, wait for error or ctx.Done

func (*Node) Stop

func (n *Node) Stop()

node stop

type NodeApi

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

func (*NodeApi) AddNode

func (api *NodeApi) AddNode(request *restful.Request, response *restful.Response)

func (*NodeApi) GetNodes

func (api *NodeApi) GetNodes(request *restful.Request, response *restful.Response)

func (*NodeApi) Register

func (api *NodeApi) Register(container *restful.Container)

func (*NodeApi) RemoveNode

func (api *NodeApi) RemoveNode(request *restful.Request, response *restful.Response)

func (*NodeApi) StopNode

func (api *NodeApi) StopNode(request *restful.Request, response *restful.Response)

Jump to

Keyboard shortcuts

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