stubclient

package
v0.8.2 Latest Latest
Warning

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

Go to latest
Published: May 27, 2025 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package stubclient provides a stub implementation of the linodeclient.LinodeClient interface. This is intended for testing purposes.

Index

Constants

View Source
const (
	// ForcedFailure is a context key used to simulate forced failures in certain methods.
	ForcedFailure = "X_Forced_Failure"

	TestAccessKey = "TEST_ACCESS_KEY"
	TestSecretKey = "TEST_SECRET_KEY"
)

Variables

View Source
var ErrUnexpectedError = errors.New("unexpected error")

ErrUnexpectedError represents an unexpected error during the stub implementation.

Functions

This section is empty.

Types

type Client

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

Client is a stub implementation of the linodeclient.LinodeClient interface. It provides placeholder methods for object storage operations.

func New

func New(opts ...Option) *Client

New creates a new instance of the Client with optional object storage objects. This is a stub function.

func (*Client) CreateObjectStorageBucket

CreateObjectStorageBucket is a stub function that stubs the behavior of CreateObjectStorageBucket call from linodego.Client.

func (*Client) CreateObjectStorageKey

CreateObjectStorageKey is a stub function that stubs the behavior of CreateObjectStorageKey call from linodego.Client.

func (*Client) DeleteObjectStorageBucket

func (c *Client) DeleteObjectStorageBucket(ctx context.Context, region, label string) error

DeleteObjectStorageBucket is a stub function that stubs the behavior of DeleteObjectStorageBucket call from linodego.Client.

func (*Client) DeleteObjectStorageKey

func (c *Client) DeleteObjectStorageKey(ctx context.Context, id int) error

DeleteObjectStorageKey is a stub function that stubs the behavior of DeleteObjectStorageKey call from linodego.Client.

func (*Client) GetObjectStorageBucket

func (c *Client) GetObjectStorageBucket(ctx context.Context, region, label string) (*linodego.ObjectStorageBucket, error)

GetObjectStorageBucket is a stub function that stubs the behavior of GetObjectStorageBucket call from linodego.Client.

func (*Client) GetObjectStorageBucketAccess

func (c *Client) GetObjectStorageBucketAccess(ctx context.Context, region, label string) (*linodego.ObjectStorageBucketAccess, error)

GetObjectStorageBucketAccess is a stub function that stubs the behavior of GetObjectStorageBucketAccess call from linodego.Client.

func (*Client) GetObjectStorageKey

func (c *Client) GetObjectStorageKey(ctx context.Context, id int) (*linodego.ObjectStorageKey, error)

GetObjectStorageKey is a stub function that stubs the behavior of GetObjectStorageKey call from linodego.Client.

func (*Client) ListObjectStorageEndpoints added in v0.5.3

func (c *Client) ListObjectStorageEndpoints(ctx context.Context, _ *linodego.ListOptions) ([]linodego.ObjectStorageEndpoint, error)

func (*Client) ListObjectStorageKeys

func (c *Client) ListObjectStorageKeys(ctx context.Context, opt *linodego.ListOptions) ([]linodego.ObjectStorageKey, error)

ListObjectStorageKeys is a stub function that stubs the behavior of ListObjectStorageKeys call from linodego.Client.

func (*Client) UpdateObjectStorageBucketAccess

func (c *Client) UpdateObjectStorageBucketAccess(ctx context.Context, region, label string, opt linodego.ObjectStorageBucketUpdateAccessOptions) error

UpdateObjectStorageBucketAccess is a stub function that stubs the behavior of UpdateObjectStorageBucketAccess call from linodego.Client.

type Option

type Option func(c *Client)

Option represents a function that configures a Client.

func WithBucket

func WithBucket(bucket *linodego.ObjectStorageBucket) Option

WithBucket is an option to configure the stub client with an Object Storage bucket.

func WithBucketAccess

func WithBucketAccess(bucketAccess *linodego.ObjectStorageBucketAccess, region, label string) Option

WithBucketAccess is an option to configure the stub client with Object Storage bucket access.

func WithEndpoint added in v0.5.3

func WithEndpoint(endpoint linodego.ObjectStorageEndpoint) Option

WithEndpoint is an option to configure the stub client with Object Storage endpoints.

func WithKey

func WithKey(key *linodego.ObjectStorageKey) Option

WithKey is an option to configure the stub client with an Object Storage key.

Jump to

Keyboard shortcuts

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