agent

package
v0.0.0-...-1c5d739 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2023 License: Apache-2.0 Imports: 10 Imported by: 8

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AgentServer

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

AgentServer The type is the API for a serviced agent. Get the host information from an agent.

func NewServer

func NewServer(staticIPs []string) *AgentServer

NewServer returns a new AgentServer

func (*AgentServer) BuildHost

func (a *AgentServer) BuildHost(request BuildHostRequest, hostResponse *host.Host) error

BuildHost creates a Host object from the current host.

func (*AgentServer) GetDockerLogs

func (a *AgentServer) GetDockerLogs(dockerID string, logs *string) error

GetDockerLogs returns the last 2000 lines of logs from the docker container

func (*AgentServer) PullImage

func (a *AgentServer) PullImage(req PullImageRequest, image *string) error

PullImage pulls a registry image into the local repository. Returns the current image tag.

type BuildHostRequest

type BuildHostRequest struct {
	IP     string // IP for the host
	Port   int    // Port to contact the host on
	PoolID string // Pool to set on host
	Memory string // Memory allotted to this host
}

BuildHostRequest request to build a new host. IP and IPResources will be validated to ensure they exist on the host. If IPResources is not set and IPResource using the IP parameter will be used

type Client

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

Client rpc client to interact with agent

func NewClient

func NewClient(addr string) (*Client, error)

NewClient Create a new Client.

func (*Client) BuildHost

func (c *Client) BuildHost(request BuildHostRequest) (*host.Host, error)

BuildHost creates a Host object from the current host.

func (*Client) Close

func (c *Client) Close() (err error)

Close closes rpc client

func (*Client) GetDockerLogs

func (c *Client) GetDockerLogs(dockerID string) (string, error)

GetDockerLogs returns the last 10k worth of logs from the docker container

func (*Client) PullImage

func (c *Client) PullImage(registry, image string, timeout time.Duration) (string, error)

PullImage pulls the image from the provided registry and returns the local image tag.

type PullImageRequest

type PullImageRequest struct {
	Registry string
	Image    string
	Timeout  time.Duration
}

PullImageRequest request to pull an image from a remote registry.

Jump to

Keyboard shortcuts

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