instancer

package
v0.2.10 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2025 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAdapterNames

func GetAdapterNames() []string

func Poll

func Poll(ctx context.Context) (bool, error)

func RegisterAdapter

func RegisterAdapter(adapter InstanceAdapter)

Types

type InstanceAdapter

type InstanceAdapter interface {
	Name() string
	StartInstance(ctx context.Context, task InstanceTask) error
	DestroyInstance(ctx context.Context, task InstanceTask) error
}

func GetAdapter

func GetAdapter(name string) (InstanceAdapter, bool)

type InstanceTask

type InstanceTask interface {
	Type() TaskType
	ProblemConfig() common.ProblemConfig
	InstanceId() string
	ProblemData() string
	Patch(ctx context.Context, patch *client.PatchInstanceTaskRequest) error
	Complete(ctx context.Context, req *client.CompleteTaskRequest) error
}

type RemoteInstanceTask

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

func (*RemoteInstanceTask) Complete

func (*RemoteInstanceTask) InstanceId

func (t *RemoteInstanceTask) InstanceId() string

func (*RemoteInstanceTask) Patch

func (*RemoteInstanceTask) ProblemConfig

func (t *RemoteInstanceTask) ProblemConfig() common.ProblemConfig

func (*RemoteInstanceTask) ProblemData

func (t *RemoteInstanceTask) ProblemData() string

func (*RemoteInstanceTask) Type

func (t *RemoteInstanceTask) Type() TaskType

type TaskType

type TaskType int
const (
	TaskTypeStart TaskType = iota
	TaskTypeDestroy
)

Jump to

Keyboard shortcuts

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