Documentation ¶
Index ¶
- Variables
- type ClientInterface
- type GcpCli
- func (g GcpCli) Client() ClientInterface
- func (g GcpCli) Config() *config.Config
- func (g *GcpCli) CreateInstance(ctx context.Context, spec *spec.RunnerSpec) (*computepb.Instance, error)
- func (g *GcpCli) DeleteInstance(ctx context.Context, instance string) error
- func (g *GcpCli) GetInstance(ctx context.Context, instanceName string) (*computepb.Instance, error)
- func (g *GcpCli) ListDescribedInstances(ctx context.Context, poolID string) ([]*computepb.Instance, error)
- func (g *GcpCli) SetClient(client ClientInterface)
- func (g *GcpCli) SetConfig(cfg *config.Config)
- func (g *GcpCli) StartInstance(ctx context.Context, instance string) error
- func (g *GcpCli) StopInstance(ctx context.Context, instance string) error
- type MockGcpClient
- func (m *MockGcpClient) Delete(ctx context.Context, req *computepb.DeleteInstanceRequest, ...) (*compute.Operation, error)
- func (m *MockGcpClient) Get(ctx context.Context, req *computepb.GetInstanceRequest, opts ...gax.CallOption) (*computepb.Instance, error)
- func (m *MockGcpClient) Insert(ctx context.Context, req *computepb.InsertInstanceRequest, ...) (*compute.Operation, error)
- func (m *MockGcpClient) List(ctx context.Context, req *computepb.ListInstancesRequest, ...) *compute.InstanceIterator
- func (m *MockGcpClient) Start(ctx context.Context, req *computepb.StartInstanceRequest, ...) (*compute.Operation, error)
- func (m *MockGcpClient) Stop(ctx context.Context, req *computepb.StopInstanceRequest, ...) (*compute.Operation, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( WaitOp = (*compute.Operation).Wait NextIt = (*compute.InstanceIterator).Next )
Functions ¶
This section is empty.
Types ¶
type ClientInterface ¶
type ClientInterface interface { Insert(ctx context.Context, req *computepb.InsertInstanceRequest, opts ...gax.CallOption) (*compute.Operation, error) Start(ctx context.Context, req *computepb.StartInstanceRequest, opts ...gax.CallOption) (*compute.Operation, error) Stop(ctx context.Context, req *computepb.StopInstanceRequest, opts ...gax.CallOption) (*compute.Operation, error) Delete(ctx context.Context, req *computepb.DeleteInstanceRequest, opts ...gax.CallOption) (*compute.Operation, error) List(ctx context.Context, req *computepb.ListInstancesRequest, opts ...gax.CallOption) *compute.InstanceIterator Get(ctx context.Context, req *computepb.GetInstanceRequest, opts ...gax.CallOption) (*computepb.Instance, error) }
type GcpCli ¶
type GcpCli struct {
// contains filtered or unexported fields
}
func (GcpCli) Client ¶
func (g GcpCli) Client() ClientInterface
func (*GcpCli) CreateInstance ¶
func (*GcpCli) DeleteInstance ¶
func (*GcpCli) GetInstance ¶
func (*GcpCli) ListDescribedInstances ¶
func (*GcpCli) SetClient ¶
func (g *GcpCli) SetClient(client ClientInterface)
func (*GcpCli) StartInstance ¶
type MockGcpClient ¶
MockGcpClient is a mock of the ClientInterface
func (*MockGcpClient) Delete ¶
func (m *MockGcpClient) Delete(ctx context.Context, req *computepb.DeleteInstanceRequest, opts ...gax.CallOption) (*compute.Operation, error)
func (*MockGcpClient) Get ¶
func (m *MockGcpClient) Get(ctx context.Context, req *computepb.GetInstanceRequest, opts ...gax.CallOption) (*computepb.Instance, error)
func (*MockGcpClient) Insert ¶
func (m *MockGcpClient) Insert(ctx context.Context, req *computepb.InsertInstanceRequest, opts ...gax.CallOption) (*compute.Operation, error)
func (*MockGcpClient) List ¶
func (m *MockGcpClient) List(ctx context.Context, req *computepb.ListInstancesRequest, opts ...gax.CallOption) *compute.InstanceIterator
func (*MockGcpClient) Start ¶
func (m *MockGcpClient) Start(ctx context.Context, req *computepb.StartInstanceRequest, opts ...gax.CallOption) (*compute.Operation, error)
func (*MockGcpClient) Stop ¶
func (m *MockGcpClient) Stop(ctx context.Context, req *computepb.StopInstanceRequest, opts ...gax.CallOption) (*compute.Operation, error)
Click to show internal directories.
Click to hide internal directories.