Help us shape the future of Go! Take the 2026 Go Developer Survey

mock

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EncodeProviderSpec

func EncodeProviderSpec(spec *api.ProviderSpec) ([]byte, error)

encodeProviderSpec is a helper function to encode ProviderSpec for tests

Types

type StackitClient

type StackitClient struct {
	CreateServerFunc func(ctx context.Context, projectID, region string, req *client.CreateServerRequest) (*client.Server, error)
	GetServerFunc    func(ctx context.Context, projectID, region, serverID string) (*client.Server, error)
	DeleteServerFunc func(ctx context.Context, projectID, region, serverID string) error
	ListServersFunc  func(ctx context.Context, projectID, region string, labelSelector map[string]string) ([]*client.Server, error)
	GetNICsFunc      func(ctx context.Context, projectID, region, serverID string) ([]*client.NIC, error)
	ListNICsFunc     func(ctx context.Context, projectID, region, networkID string) ([]*client.NIC, error)
	DeleteNICFunc    func(ctx context.Context, projectID, region, networkID, nicID string) error
	ListVolumesFunc  func(ctx context.Context, projectID, region string) ([]*client.Volume, error)
	GetVolumeFunc    func(ctx context.Context, projectID, region, volumeID string) (*client.Volume, error)
	DeleteVolumeFunc func(ctx context.Context, projectID, region, volumeID string) error
	UpdateNICFunc    func(ctx context.Context, projectID, region, networkID, nicID string, allowedAddresses []string) (*client.NIC, error)
}

StackitClient is a mock implementation of StackitClient for testing Note: Single-tenant design - each client is bound to one set of credentials

func (*StackitClient) CreateServer

func (m *StackitClient) CreateServer(ctx context.Context, projectID, region string, req *client.CreateServerRequest) (*client.Server, error)

func (*StackitClient) DeleteNIC added in v0.11.0

func (m *StackitClient) DeleteNIC(ctx context.Context, projectID, region, networkID, nicID string) error

func (*StackitClient) DeleteServer

func (m *StackitClient) DeleteServer(ctx context.Context, projectID, region, serverID string) error

func (*StackitClient) DeleteVolume added in v0.11.0

func (m *StackitClient) DeleteVolume(ctx context.Context, projectID, region, volumeID string) error

func (*StackitClient) GetNICsForServer

func (m *StackitClient) GetNICsForServer(ctx context.Context, projectID, region, serverID string) ([]*client.NIC, error)

func (*StackitClient) GetServer

func (m *StackitClient) GetServer(ctx context.Context, projectID, region, serverID string) (*client.Server, error)

func (*StackitClient) GetVolume added in v0.11.0

func (m *StackitClient) GetVolume(ctx context.Context, projectID, region, volumeID string) (*client.Volume, error)

func (*StackitClient) ListNICs added in v0.11.0

func (m *StackitClient) ListNICs(ctx context.Context, projectID, region, networkID string) ([]*client.NIC, error)

func (*StackitClient) ListServers

func (m *StackitClient) ListServers(ctx context.Context, projectID, region string, labelSelector map[string]string) ([]*client.Server, error)

func (*StackitClient) ListVolumes added in v0.11.0

func (m *StackitClient) ListVolumes(ctx context.Context, projectID, region string) ([]*client.Volume, error)

func (*StackitClient) UpdateNIC

func (m *StackitClient) UpdateNIC(ctx context.Context, projectID, region, networkID, nicID string, allowedAddresses []string) (*client.NIC, error)

Jump to

Keyboard shortcuts

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