Documentation ¶
Index ¶
- Constants
- Variables
- func NewLXDProvider(configFile, controllerID string) (execution.ExternalProvider, error)
- type GetCloudConfigFunc
- type InstanceServerInterface
- type LXD
- func (l *LXD) CreateInstance(ctx context.Context, bootstrapParams commonParams.BootstrapInstance) (commonParams.ProviderInstance, error)
- func (l *LXD) DeleteInstance(ctx context.Context, instance string) error
- func (l *LXD) GetInstance(ctx context.Context, instanceName string) (commonParams.ProviderInstance, error)
- func (l *LXD) ListInstances(ctx context.Context, poolID string) ([]commonParams.ProviderInstance, error)
- func (l *LXD) RemoveAllInstances(ctx context.Context) error
- func (l *LXD) Start(ctx context.Context, instance string) error
- func (l *LXD) Stop(ctx context.Context, instance string, force bool) error
- type MockLXDServer
- func (m *MockLXDServer) CreateInstance(instance api.InstancesPost) (lxd.Operation, error)
- func (m *MockLXDServer) DeleteInstance(projectName string) (lxd.Operation, error)
- func (m *MockLXDServer) GetImage(fingerprint string) (*api.Image, string, error)
- func (m *MockLXDServer) GetImageAliasArchitectures(imageType string, imageName string) (map[string]*api.ImageAliasesEntry, error)
- func (m *MockLXDServer) GetInstanceFull(projectName string) (*api.InstanceFull, string, error)
- func (m *MockLXDServer) GetInstancesFull(instanceType api.InstanceType) ([]api.InstanceFull, error)
- func (m *MockLXDServer) GetProfileNames() ([]string, error)
- func (m *MockLXDServer) GetProject(projectName string) (*api.Project, string, error)
- func (m *MockLXDServer) UpdateInstanceState(projectName string, state api.InstanceStatePut, instanceName string) (lxd.Operation, error)
- func (m *MockLXDServer) UseProject(projectName string) lxd.InstanceServer
- type MockOperation
- func (m *MockOperation) AddHandler(handler func(api.Operation)) (target *lxd.EventTarget, err error)
- func (m *MockOperation) Cancel() error
- func (m *MockOperation) Get() api.Operation
- func (m *MockOperation) GetWebsocket(secret string) (conn *websocket.Conn, err error)
- func (m *MockOperation) Refresh() error
- func (m *MockOperation) RemoveHandler(target *lxd.EventTarget) error
- func (m *MockOperation) Wait() error
- func (m *MockOperation) WaitContext(ctx context.Context) error
- type ToolFetchFunc
Constants ¶
View Source
const ( DefaultProjectDescription = "This project was created automatically by garm to be used for github ephemeral action runners." DefaultProjectName = "garm-project" )
Variables ¶
View Source
var ( DefaultToolFetch ToolFetchFunc = util.GetTools DefaultGetCloudconfig GetCloudConfigFunc = cloudconfig.GetCloudConfig )
Functions ¶
func NewLXDProvider ¶
func NewLXDProvider(configFile, controllerID string) (execution.ExternalProvider, error)
Types ¶
type GetCloudConfigFunc ¶
type GetCloudConfigFunc func(bootstrapParams commonParams.BootstrapInstance, tools commonParams.RunnerApplicationDownload, runnerName string) (string, error)
type InstanceServerInterface ¶
type InstanceServerInterface interface { GetImageAliasArchitectures(string, string) (map[string]*api.ImageAliasesEntry, error) GetImage(fingerprint string) (*api.Image, string, error) GetProject(name string) (*api.Project, string, error) UseProject(name string) lxd.InstanceServer GetProfileNames() ([]string, error) CreateInstance(instance api.InstancesPost) (lxd.Operation, error) UpdateInstanceState(name string, state api.InstanceStatePut, ETag string) (lxd.Operation, error) GetInstanceFull(name string) (*api.InstanceFull, string, error) DeleteInstance(name string) (lxd.Operation, error) GetInstancesFull(instanceType api.InstanceType) ([]api.InstanceFull, error) }
type LXD ¶
type LXD struct {
// contains filtered or unexported fields
}
func (*LXD) CreateInstance ¶
func (l *LXD) CreateInstance(ctx context.Context, bootstrapParams commonParams.BootstrapInstance) (commonParams.ProviderInstance, error)
CreateInstance creates a new compute instance in the provider.
func (*LXD) DeleteInstance ¶
Delete instance will delete the instance in a provider.
func (*LXD) GetInstance ¶
func (l *LXD) GetInstance(ctx context.Context, instanceName string) (commonParams.ProviderInstance, error)
GetInstance will return details about one instance.
func (*LXD) ListInstances ¶
func (l *LXD) ListInstances(ctx context.Context, poolID string) ([]commonParams.ProviderInstance, error)
ListInstances will list all instances for a provider.
func (*LXD) RemoveAllInstances ¶
RemoveAllInstances will remove all instances created by this provider.
type MockLXDServer ¶
func (*MockLXDServer) CreateInstance ¶
func (m *MockLXDServer) CreateInstance(instance api.InstancesPost) (lxd.Operation, error)
func (*MockLXDServer) DeleteInstance ¶
func (m *MockLXDServer) DeleteInstance(projectName string) (lxd.Operation, error)
func (*MockLXDServer) GetImageAliasArchitectures ¶
func (m *MockLXDServer) GetImageAliasArchitectures(imageType string, imageName string) (map[string]*api.ImageAliasesEntry, error)
func (*MockLXDServer) GetInstanceFull ¶
func (m *MockLXDServer) GetInstanceFull(projectName string) (*api.InstanceFull, string, error)
func (*MockLXDServer) GetInstancesFull ¶
func (m *MockLXDServer) GetInstancesFull(instanceType api.InstanceType) ([]api.InstanceFull, error)
func (*MockLXDServer) GetProfileNames ¶
func (m *MockLXDServer) GetProfileNames() ([]string, error)
func (*MockLXDServer) GetProject ¶
func (*MockLXDServer) UpdateInstanceState ¶
func (m *MockLXDServer) UpdateInstanceState(projectName string, state api.InstanceStatePut, instanceName string) (lxd.Operation, error)
func (*MockLXDServer) UseProject ¶
func (m *MockLXDServer) UseProject(projectName string) lxd.InstanceServer
type MockOperation ¶
func (*MockOperation) AddHandler ¶
func (m *MockOperation) AddHandler(handler func(api.Operation)) (target *lxd.EventTarget, err error)
func (*MockOperation) Cancel ¶
func (m *MockOperation) Cancel() error
func (*MockOperation) Get ¶
func (m *MockOperation) Get() api.Operation
func (*MockOperation) GetWebsocket ¶
func (m *MockOperation) GetWebsocket(secret string) (conn *websocket.Conn, err error)
func (*MockOperation) Refresh ¶
func (m *MockOperation) Refresh() error
func (*MockOperation) RemoveHandler ¶
func (m *MockOperation) RemoveHandler(target *lxd.EventTarget) error
func (*MockOperation) Wait ¶
func (m *MockOperation) Wait() error
func (*MockOperation) WaitContext ¶
func (m *MockOperation) WaitContext(ctx context.Context) error
type ToolFetchFunc ¶
type ToolFetchFunc func(osType commonParams.OSType, osArch commonParams.OSArch, tools []commonParams.RunnerApplicationDownload) (commonParams.RunnerApplicationDownload, error)
Click to show internal directories.
Click to hide internal directories.