mock

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 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)
	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) DeleteServer

func (m *StackitClient) DeleteServer(ctx context.Context, projectID, region, serverID 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) ListServers

func (m *StackitClient) ListServers(ctx context.Context, projectID, region string, labelSelector map[string]string) ([]*client.Server, 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