agent

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2024 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Agent

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

func New

func New(config config.RavelConfig) (*Agent, error)

func (*Agent) CreateInstance

func (a *Agent) CreateInstance(ctx context.Context, opt core.CreateInstancePayload) (*core.Instance, error)

func (*Agent) DestroyInstance

func (s *Agent) DestroyInstance(ctx context.Context, id string, force bool) error

func (*Agent) GetInstance

func (a *Agent) GetInstance(ctx context.Context, id string) (*core.Instance, error)

func (*Agent) GetInstanceLogs

func (a *Agent) GetInstanceLogs(ctx context.Context, id string) ([]*core.LogEntry, error)

func (*Agent) InstanceExec

func (s *Agent) InstanceExec(ctx context.Context, id string, opt core.InstanceExecOptions) (*core.ExecResult, error)

func (*Agent) ListInstances

func (d *Agent) ListInstances(ctx context.Context) ([]core.Instance, error)

func (*Agent) Start

func (d *Agent) Start(ctx context.Context) error

func (*Agent) StartInstance

func (s *Agent) StartInstance(ctx context.Context, id string) error

func (*Agent) Stop

func (d *Agent) Stop() error

func (*Agent) StopInstance

func (s *Agent) StopInstance(ctx context.Context, id string, opt *core.StopConfig) error

func (*Agent) SubscribeToInstanceLogs

func (a *Agent) SubscribeToInstanceLogs(ctx context.Context, id string) (<-chan []*core.LogEntry, error)

type AgentServer

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

func NewAgentServer

func NewAgentServer(agent core.Agent, address string) *AgentServer

func (*AgentServer) ListenAndServe

func (s *AgentServer) ListenAndServe() error

func (*AgentServer) Shutdown

func (s *AgentServer) Shutdown(ctx context.Context) error

type CreateInstanceRequest

type CreateInstanceRequest struct {
	Body core.CreateInstancePayload
}

type CreateInstanceResponse

type CreateInstanceResponse struct {
	Body *core.Instance
}

type DestroyInstanceRequest

type DestroyInstanceRequest struct {
	Id    string `path:"id"`
	Force bool   `query:"force"`
}

type DestroyInstanceResponse

type DestroyInstanceResponse struct {
}

type ExecBody

type ExecBody struct {
	Cmd     []string `json:"cmd"`
	Timeout int      `json:"timeout"`
}

type ExecRequest

type ExecRequest struct {
	Id   string `path:"id"`
	Body core.InstanceExecOptions
}

type ExecResponse

type ExecResponse struct {
	Body *core.ExecResult
}

type GetInstanceLogsRequest

type GetInstanceLogsRequest struct {
	Id     string `path:"id"`
	Follow bool   `query:"follow"`
}

type GetInstanceLogsResponse

type GetInstanceLogsResponse struct {
	Body []byte
}

type GetInstanceRequest

type GetInstanceRequest struct {
	Id string `path:"id"`
}

type GetInstanceResponse

type GetInstanceResponse struct {
	Body core.Instance
}

type ListInstancesRequest

type ListInstancesRequest struct {
}

type ListInstancesResponse

type ListInstancesResponse struct {
	Body []core.Instance
}

type StartInstanceRequest

type StartInstanceRequest struct {
	Id string `path:"id"`
}

type StartInstanceResponse

type StartInstanceResponse struct {
}

type StopInstanceRequest

type StopInstanceRequest struct {
	Id   string           `path:"id"`
	Body *core.StopConfig `required:"false"`
}

type StopInstanceResponse

type StopInstanceResponse struct {
}

Jump to

Keyboard shortcuts

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