crusoe

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUnknownDiskSizeSuffix = errors.New("unknown disk size suffix")

	ErrDiskNotFound           = errors.New("disk not found")
	ErrDiskDifferentSize      = errors.New("disk has different size")
	ErrDiskDifferentName      = errors.New("disk has different name")
	ErrDiskDifferentLocation  = errors.New("disk has different location")
	ErrDiskDifferentBlockSize = errors.New("disk has different block size")
	ErrDiskDifferentType      = errors.New("disk has different type")
)

Functions

func CheckDiskAttached

func CheckDiskAttached(ctx context.Context,
	crusoeClient *crusoeapi.APIClient,
	diskID,
	instanceID,
	projectID string,
) (bool, error)

func CheckDiskMatchesRequest

func CheckDiskMatchesRequest(disk *crusoeapi.DiskV1Alpha5,
	request *csi.CreateVolumeRequest,
	expectedLocation string,
	expectedType common.DiskType,
) error

func FindDiskByIDFallible

func FindDiskByIDFallible(ctx context.Context,
	crusoeClient *crusoeapi.APIClient,
	projectID string,
	diskID string,
) (*crusoeapi.DiskV1Alpha5, error)

func FindDiskByNameFallible

func FindDiskByNameFallible(ctx context.Context,
	crusoeClient *crusoeapi.APIClient,
	projectID string,
	name string,
) (*crusoeapi.DiskV1Alpha5, error)

func GetCreateDiskRequest

func GetCreateDiskRequest(request *csi.CreateVolumeRequest,
	location string,
	diskType common.DiskType,
) (*crusoeapi.DisksPostRequestV1Alpha5, error)

func GetVolumeFromDisk

func GetVolumeFromDisk(disk *crusoeapi.DiskV1Alpha5,

	pluginName,
	location string,
	diskType common.DiskType) (
	*csi.Volume,
	error,
)

func NewCrusoeClient

func NewCrusoeClient(host, key, secret, userAgent string) *crusoeapi.APIClient

NewCrusoeClient initializes a new Crusoe API client with the given configuration.

func NormalizeDiskSizeToGiB

func NormalizeDiskSizeToGiB(disk *crusoeapi.DiskV1Alpha5) (int, error)

Types

type AuthenticatingTransport

type AuthenticatingTransport struct {
	http.RoundTripper
	// contains filtered or unexported fields
}

AuthenticatingTransport is a struct implementing http.Roundtripper that authenticates a request to Crusoe Cloud before sending it out.

func NewAuthenticatingTransport

func NewAuthenticatingTransport(r http.RoundTripper, keyID, secretKey string) AuthenticatingTransport

func (AuthenticatingTransport) RoundTrip

func (t AuthenticatingTransport) RoundTrip(r *http.Request) (*http.Response, error)

Jump to

Keyboard shortcuts

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