component

package
v0.0.0-...-15eb78e Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2022 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PINGPONG = "pingpong"
	HOSTINFO = "hostinfo"
)

PINGPONG name literal

Variables

This section is empty.

Functions

This section is empty.

Types

type Agent

type Agent struct {
	Host Host

	ServiceConnection *websocket.Conn
	BinDir            string
	TempDir           string
	// contains filtered or unexported fields
}

Agent represents an instance of the CC Agent

func GetHostAgent

func GetHostAgent() (agent *Agent)

GetHostAgent returns the Agent singleton for the host

func NewAgent

func NewAgent() (agent *Agent)

NewAgent factory method for Agent

func (*Agent) ProcessRequest

func (agent *Agent) ProcessRequest(managementServiceRequest lib.CCServiceRequest) (err error)

ProcessRequest processes the command received via the CC Service

type AlgodNode

type AlgodNode struct {
	Name    string
	Status  string
	DataDir string
}

AlgodNode represents an Algod Node (aka Algod Instance)

type Command

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

Command is a command object for Components

type CommandStatus

type CommandStatus int

CommandStatus for tracking status of commands

const (
	START     CommandStatus = 0
	COMPLETED CommandStatus = 1
	FAILED    CommandStatus = 2
)

START, COMPLETED, FAILED are command status values

func (CommandStatus) String

func (status CommandStatus) String() string

String returns the string value for the command status

type Component

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

Component base structure inherited by all CC Components

type Host

type Host struct {
	Name    string
	NodeMap map[string]AlgodNode
}

Host represents the server hosting the CC Agent and Algod Nodes

type Instance

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

Instance represents a Component Instance (component + algod node)

func (*Instance) Init

func (comp *Instance) Init() (err error)

Init component instance

func (*Instance) Process

func (comp *Instance) Process(command Command) (err error)

Process component instance command

func (*Instance) Terminate

func (comp *Instance) Terminate() (err error)

Terminate component instance

type PingPongComponentInstance

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

PingPongComponentInstance extends component instance supports management of ping pong instances

func (*PingPongComponentInstance) Init

func (componentInstance *PingPongComponentInstance) Init() (err error)

Init the PingPong instance

func (*PingPongComponentInstance) Process

func (componentInstance *PingPongComponentInstance) Process(command Command) (err error)

Process the ping pong instance

func (*PingPongComponentInstance) Terminate

func (componentInstance *PingPongComponentInstance) Terminate() (err error)

Terminate the ping pong instance

Jump to

Keyboard shortcuts

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