Documentation
¶
Overview ¶
Package stubclient provides a stub implementation of the linodeclient.LinodeClient interface. This is intended for testing purposes.
Index ¶
- Constants
- Variables
- type Client
- func (c *Client) CreateObjectStorageBucket(ctx context.Context, opt linodego.ObjectStorageBucketCreateOptions) (*linodego.ObjectStorageBucket, error)
- func (c *Client) CreateObjectStorageKey(ctx context.Context, opt linodego.ObjectStorageKeyCreateOptions) (*linodego.ObjectStorageKey, error)
- func (c *Client) DeleteObjectStorageBucket(ctx context.Context, clusterID, label string) error
- func (c *Client) DeleteObjectStorageKey(ctx context.Context, id int) error
- func (c *Client) GetObjectStorageBucket(ctx context.Context, clusterID, label string) (*linodego.ObjectStorageBucket, error)
- func (c *Client) GetObjectStorageBucketAccess(ctx context.Context, clusterID, label string) (*linodego.ObjectStorageBucketAccess, error)
- func (c *Client) GetObjectStorageKey(ctx context.Context, id int) (*linodego.ObjectStorageKey, error)
- func (c *Client) ListObjectStorageKeys(ctx context.Context, opt *linodego.ListOptions) ([]linodego.ObjectStorageKey, error)
- func (c *Client) UpdateObjectStorageBucketAccess(ctx context.Context, clusterID, label string, ...) error
- type Option
Constants ¶
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 ¶
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 ¶
New creates a new instance of the Client with optional object storage objects. This is a stub function.
func (*Client) CreateObjectStorageBucket ¶
func (c *Client) CreateObjectStorageBucket(ctx context.Context, opt linodego.ObjectStorageBucketCreateOptions) (*linodego.ObjectStorageBucket, error)
CreateObjectStorageBucket is a stub function that stubs the behavior of CreateObjectStorageBucket call from linodego.Client.
func (*Client) CreateObjectStorageKey ¶
func (c *Client) CreateObjectStorageKey(ctx context.Context, opt linodego.ObjectStorageKeyCreateOptions) (*linodego.ObjectStorageKey, error)
CreateObjectStorageKey is a stub function that stubs the behavior of CreateObjectStorageKey call from linodego.Client.
func (*Client) DeleteObjectStorageBucket ¶
DeleteObjectStorageBucket is a stub function that stubs the behavior of DeleteObjectStorageBucket call from linodego.Client.
func (*Client) DeleteObjectStorageKey ¶
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, clusterID, 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, clusterID, 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) 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, clusterID, 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, cluster, label string) Option
WithBucketAccess is an option to configure the stub client with Object Storage bucket access.
func WithKey ¶
func WithKey(key *linodego.ObjectStorageKey) Option
WithKey is an option to configure the stub client with an Object Storage key.