api

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: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AgentClient

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

func NewAgentClient

func NewAgentClient(c *http.Client, baseUrl string) *AgentClient

func (*AgentClient) CreateInstance

func (a *AgentClient) CreateInstance(ctx context.Context, options core.CreateInstancePayload) (*core.Instance, error)

func (*AgentClient) DestroyInstance

func (a *AgentClient) DestroyInstance(ctx context.Context, id string, force bool) error

func (*AgentClient) GetInstance

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

func (*AgentClient) GetInstanceLogs

func (a *AgentClient) GetInstanceLogs(ctx context.Context, id string, follow bool) (<-chan *core.LogEntry, error)

func (*AgentClient) GetInstanceLogsRaw

func (a *AgentClient) GetInstanceLogsRaw(ctx context.Context, id string, follow bool) (io.ReadCloser, error)

func (*AgentClient) InstanceExec

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

func (*AgentClient) ListInstances

func (a *AgentClient) ListInstances(ctx context.Context) ([]core.Instance, error)

func (*AgentClient) StartInstance

func (a *AgentClient) StartInstance(ctx context.Context, id string) error

func (*AgentClient) StopInstance

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

type CreateFleetBody

type CreateFleetBody struct {
	Name string `json:"name"`
}

type CreateNamespaceBody

type CreateNamespaceBody struct {
	Name string `json:"name"`
}

type Machine

type Machine struct {
	Id             string             `json:"id"`
	Namespace      string             `json:"namespace"`
	FleetId        string             `json:"fleet"`
	InstanceId     string             `json:"instance_id"`
	MachineVersion ulid.ULID          `json:"machine_version"`
	Region         string             `json:"region"`
	Config         core.MachineConfig `json:"config"`
	CreatedAt      time.Time          `json:"created_at"`
	UpdatedAt      time.Time          `json:"updated_at"`
	State          core.MachineStatus `json:"state"`
}

type Namespace

type Namespace struct {
	Name      string    `json:"name"`
	CreatedAt time.Time `json:"created_at"`
}

type Opt

type Opt func(*opt)

func WithNamespace

func WithNamespace(namespace string) Opt

type RavelClient

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

func NewRavelClient

func NewRavelClient(opts ...RavelClientOpt) *RavelClient

func (*RavelClient) CreateFleet

func (rc *RavelClient) CreateFleet(ctx context.Context, name string, opts ...Opt) (*core.Fleet, error)

func (*RavelClient) CreateNamespace

func (rc *RavelClient) CreateNamespace(ctx context.Context, name string) (*Namespace, error)

func (*RavelClient) GetNamespace

func (rc *RavelClient) GetNamespace(ctx context.Context, namespace string) (*Namespace, error)

func (*RavelClient) ListFleets

func (rc *RavelClient) ListFleets(ctx context.Context, namespace string) ([]core.Fleet, error)

func (*RavelClient) ListNamespaces

func (rc *RavelClient) ListNamespaces(ctx context.Context) ([]Namespace, error)

type RavelClientOpt

type RavelClientOpt func(*ravelClientOptions)

func WithApiUrl

func WithApiUrl(url string) RavelClientOpt

func WithDefaultNamespace

func WithDefaultNamespace(namespace string) RavelClientOpt

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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