node

package
v0.0.133-smrctl Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2025 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Node

type Node struct {
	Name       string
	Index      int
	Image      string
	Tag        string
	Join       bool
	Peer       string
	BinaryPath string
	Cleaned    bool

	IP      string
	Context string

	Ports Ports
	// contains filtered or unexported fields
}

func New

func New(t *testing.T, opts Options) (*Node, error)

func (*Node) Clean

func (n *Node) Clean(t *testing.T) error

func (*Node) GetContext

func (n *Node) GetContext() string

func (*Node) GetIP

func (n *Node) GetIP() string

func (*Node) GetPorts

func (n *Node) GetPorts() Ports

func (*Node) GetSmr

func (n *Node) GetSmr() *engine.Engine

func (*Node) GetSudoSmr

func (n *Node) GetSudoSmr() *engine.Engine

func (*Node) Import

func (n *Node) Import(t *testing.T, context string) error

func (*Node) RunCommand

func (n *Node) RunCommand(t *testing.T, command string) (string, error)

func (*Node) SetNodePorts

func (n *Node) SetNodePorts(control, etcd, overlay int)

func (*Node) Start

func (n *Node) Start(t *testing.T) error

func (*Node) WaitForEvent

func (n *Node) WaitForEvent(t *testing.T, eventName string, timeout time.Duration) error

type NodeCleaner

type NodeCleaner interface {
	Clean(*testing.T) error
	GetPorts() Ports
	GetIP() string
	GetContext() string
	GetSmr() *engine.Engine
	Import(t *testing.T, context string) error
}

type NodeManager

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

func NewNodeManager

func NewNodeManager() *NodeManager

func (*NodeManager) Add

func (nm *NodeManager) Add(t *testing.T, node NodeCleaner)

func (*NodeManager) CleanAll

func (nm *NodeManager) CleanAll(t *testing.T)

func (*NodeManager) CreateAndStartNode

func (nm *NodeManager) CreateAndStartNode(t *testing.T,
	creatorFn func(*testing.T) (NodeCleaner, error),
	startFn func(NodeCleaner, *testing.T) error) (NodeCleaner, error)

func (*NodeManager) CreateAndStartNodeWithOptions

func (nm *NodeManager) CreateAndStartNodeWithOptions(t *testing.T,
	creatorFn func(*testing.T, interface{}) (NodeCleaner, error),
	opts interface{},
	startFn func(NodeCleaner, *testing.T) error) (NodeCleaner, error)

func (*NodeManager) CreateNode

func (nm *NodeManager) CreateNode(t *testing.T, creatorFn func(*testing.T) (NodeCleaner, error)) (NodeCleaner, error)

func (*NodeManager) CreateNodeWithOptions

func (nm *NodeManager) CreateNodeWithOptions(t *testing.T, creatorFn func(*testing.T, interface{}) (NodeCleaner, error), opts interface{}) (NodeCleaner, error)

func (*NodeManager) HandleError

func (nm *NodeManager) HandleError(t *testing.T, err error, message string) bool

func (*NodeManager) RunCommand

func (nm *NodeManager) RunCommand(t *testing.T, runFn func() error, cmdDescription string)

func (*NodeManager) SetupTestCleanup

func (nm *NodeManager) SetupTestCleanup(t *testing.T)

type Options

type Options struct {
	Name       string
	Index      int
	Image      string
	Tag        string
	Join       bool
	Peer       string
	BinaryPath string
}

func DefaultNodeOptions

func DefaultNodeOptions(name string, index int) Options

type Ports

type Ports struct {
	Control int
	Etcd    int
	Overlay int
}

Jump to

Keyboard shortcuts

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