component

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2025 License: AGPL-3.0 Imports: 11 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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