cluster

package
v0.0.0-...-169a2f2 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2021 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddJuriaFlags

func AddJuriaFlags(cmd *exec.Cmd, config *node.Config)

func MakePeers

func MakePeers(keys []*core.PrivateKey, addrs []multiaddr.Multiaddr) []node.Peer

func MakeRandomKeys

func MakeRandomKeys(count int) []*core.PrivateKey

func ReadRemoteHosts

func ReadRemoteHosts(hostsPath string, nodeCount int) ([]string, error)

func RunCommand

func RunCommand(cmd *exec.Cmd) error

func SetupTemplateDir

func SetupTemplateDir(dir string, keys []*core.PrivateKey, vlds []node.Peer) error

func WriteGenesisFile

func WriteGenesisFile(datadir string, genesis *node.Genesis) error

func WriteNodeKey

func WriteNodeKey(datadir string, key *core.PrivateKey) error

func WritePeersFile

func WritePeersFile(datadir string, peers []node.Peer) error

Types

type Cluster

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

func (*Cluster) GetNode

func (cls *Cluster) GetNode(idx int) Node

func (*Cluster) NodeConfig

func (cls *Cluster) NodeConfig() node.Config

func (*Cluster) NodeCount

func (cls *Cluster) NodeCount() int

func (*Cluster) RemoveEffects

func (cls *Cluster) RemoveEffects()

func (*Cluster) Start

func (cls *Cluster) Start() error

func (*Cluster) Stop

func (cls *Cluster) Stop()

type ClusterFactory

type ClusterFactory interface {
	SetupCluster(name string) (*Cluster, error)
}

type LocalFactory

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

func NewLocalFactory

func NewLocalFactory(params LocalFactoryParams) (*LocalFactory, error)

func (*LocalFactory) SetupCluster

func (ftry *LocalFactory) SetupCluster(name string) (*Cluster, error)

type LocalFactoryParams

type LocalFactoryParams struct {
	JuriaPath string
	WorkDir   string
	NodeCount int

	NodeConfig node.Config
}

type LocalNode

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

func (*LocalNode) EffectDelay

func (node *LocalNode) EffectDelay(d time.Duration) error

func (*LocalNode) EffectLoss

func (node *LocalNode) EffectLoss(percent float32) error

func (*LocalNode) GetEndpoint

func (node *LocalNode) GetEndpoint() string

func (*LocalNode) IsRunning

func (node *LocalNode) IsRunning() bool

func (*LocalNode) RemoveEffect

func (node *LocalNode) RemoveEffect()

func (*LocalNode) Start

func (node *LocalNode) Start() error

func (*LocalNode) Stop

func (node *LocalNode) Stop()

type Node

type Node interface {
	Start() error
	Stop()
	EffectDelay(d time.Duration) error
	EffectLoss(percent float32) error
	RemoveEffect()
	IsRunning() bool
	GetEndpoint() string
}

type RemoteFactory

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

func NewRemoteFactory

func NewRemoteFactory(params RemoteFactoryParams) (*RemoteFactory, error)

func (*RemoteFactory) GetHosts

func (ftry *RemoteFactory) GetHosts() []string

func (*RemoteFactory) GetParams

func (ftry *RemoteFactory) GetParams() RemoteFactoryParams

func (*RemoteFactory) SetupCluster

func (ftry *RemoteFactory) SetupCluster(name string) (*Cluster, error)

type RemoteFactoryParams

type RemoteFactoryParams struct {
	JuriaPath string
	WorkDir   string
	NodeCount int

	NodeConfig node.Config

	LoginName string // e.g ubuntu
	KeySSH    string
	HostsPath string // file path to host ip addresses

	RemoteWorkDir string
	SetupRequired bool

	NetworkDevice string
}

type RemoteNode

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

func (*RemoteNode) DownloadDstat

func (node *RemoteNode) DownloadDstat(filepath string)

func (*RemoteNode) EffectDelay

func (node *RemoteNode) EffectDelay(d time.Duration) error

func (*RemoteNode) EffectLoss

func (node *RemoteNode) EffectLoss(percent float32) error

func (*RemoteNode) GetEndpoint

func (node *RemoteNode) GetEndpoint() string

func (*RemoteNode) InstallDstat

func (node *RemoteNode) InstallDstat()

func (*RemoteNode) IsRunning

func (node *RemoteNode) IsRunning() bool

func (*RemoteNode) RemoveDB

func (node *RemoteNode) RemoveDB()

func (*RemoteNode) RemoveEffect

func (node *RemoteNode) RemoveEffect()

func (*RemoteNode) Start

func (node *RemoteNode) Start() error

func (*RemoteNode) StartDstat

func (node *RemoteNode) StartDstat()

func (*RemoteNode) Stop

func (node *RemoteNode) Stop()

func (*RemoteNode) StopDstat

func (node *RemoteNode) StopDstat()

Jump to

Keyboard shortcuts

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