gstorage

package module
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2022 License: MPL-2.0 Imports: 9 Imported by: 0

README

G-Core Labs Storage API Golang SDK

The purpose of this project is to cover G-Core Storage API methods related with G-Core Terraform plugin (https://github.com/G-Core/terraform-provider-gcorelabs).

Internal design of SDK

Since Storage service provides Swagger open docs so we generate an actual version of the client with https://goswagger.io/generate/client.html. And we extend our wrapper of this client after. Read Makefile to get more technical details.

Status

Build Status

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EmptyResultErr

type EmptyResultErr string

EmptyResultErr customize

func (EmptyResultErr) Error

func (e EmptyResultErr) Error() string

Error implemented

type ResponseErr

type ResponseErr string

ResponseErr customize

func (ResponseErr) Error

func (e ResponseErr) Error() string

Error implemented

type SDK

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

SDK for g-core storage api

func NewSDK

func NewSDK(apiHost, apiBasePath string, opts ...SdkOpt) *SDK

NewSDK constructor of storage api swagger client wrapper see UI of your data here https://api.gcorelabs.com/storage apiHost = https://api.gcorelabs.com apiBasePath = /storage

func (SDK) BucketCORS

func (sdk SDK) BucketCORS(opts ...func(params *storage.GetStorageBucketCORSHTTPParams)) (string, error)

BucketCORS getter for g-core storage api

func (SDK) BucketsList

func (sdk SDK) BucketsList(opts ...func(params *storage.StorageListBucketsHTTPParams)) ([]models.BucketDto, error)

BucketsList getter for g-core storage api same result like on UI here https://storage.gcorelabs.com/bucket/{storageID}

func (SDK) CreateBucket

func (sdk SDK) CreateBucket(opts ...func(params *storage.StorageBucketCreateHTTPParams)) error

CreateBucket writer for g-core storage api

func (SDK) CreateBucketCORS

func (sdk SDK) CreateBucketCORS(opts ...func(params *storage.StorageBucketCORSCreateHTTPParams)) error

CreateBucketCORS writer for g-core storage api

func (SDK) CreateBucketLifecycle

func (sdk SDK) CreateBucketLifecycle(opts ...func(params *storage.StorageBucketLifecycleCreateHTTPParams)) error

CreateBucketLifecycle writer for g-core storage api

func (SDK) CreateBucketPolicy

func (sdk SDK) CreateBucketPolicy(opts ...func(params *storage.StorageBucketPolicyCreateHTTPParams)) error

CreateBucketPolicy writer for g-core storage api

func (SDK) CreateKey

func (sdk SDK) CreateKey(opts ...func(*key.KeyCreateHTTPParams)) (*models.Key, error)

CreateKey writer for g-core storage api

func (SDK) CreateStorage

func (sdk SDK) CreateStorage(opts ...func(params *storage.StorageCreateHTTPParams)) (*models.Storage, error)

CreateStorage writer for g-core storage api

func (SDK) DeleteBucket

func (sdk SDK) DeleteBucket(opts ...func(params *storage.StorageBucketRemoveHTTPParams)) error

DeleteBucket writer for g-core storage api

func (SDK) DeleteBucketLifecycle

func (sdk SDK) DeleteBucketLifecycle(opts ...func(params *storage.StorageBucketLifecycleDeleteHTTPParams)) error

DeleteBucketLifecycle writer for g-core storage api

func (SDK) DeleteKey

func (sdk SDK) DeleteKey(opts ...func(*key.KeyDeleteHTTPParams)) error

DeleteKey writer for g-core storage api

func (SDK) DeleteStorage

func (sdk SDK) DeleteStorage(opts ...func(params *storage.StorageDeleteHTTPParams)) error

DeleteStorage writer for g-core storage api be noticed that delete action is async in g-core end service

func (SDK) KeysList

func (sdk SDK) KeysList(opts ...func(*key.KeyListHTTPV2Params)) ([]models.Key, error)

KeysList getter for g-core storage api same result like on UI here https://storage.gcorelabs.com/ssh-key/list

func (SDK) LinkKeyToStorage

func (sdk SDK) LinkKeyToStorage(opts ...func(params *storage.KeyLinkHTTPParams)) error

LinkKeyToStorage writer for g-core storage api

func (SDK) ModifyStorage

func (sdk SDK) ModifyStorage(opts ...func(params *storage.StorageUpdateHTTPParams)) (*models.Storage, error)

ModifyStorage writer for g-core storage api

func (SDK) StoragesList

func (sdk SDK) StoragesList(opts ...func(params *storage.StorageListHTTPV2Params)) ([]models.Storage, error)

StoragesList getter for g-core storage api same result like on UI here https://storage.gcorelabs.com/storage/list

func (SDK) UnlinkKeyFromStorage

func (sdk SDK) UnlinkKeyFromStorage(opts ...func(params *storage.KeyUnlinkHTTPParams)) error

UnlinkKeyFromStorage writer for g-core storage api

func (SDK) UpdateStorageCredentials

func (sdk SDK) UpdateStorageCredentials(
	opts ...func(params *storage.StorageUpdateCredentialsHTTPParams)) (*models.Credentials, error)

UpdateStorageCredentials writer for g-core storage api

type SdkOpt

type SdkOpt func(sdk *apiCore)

SdkOpt is optional arg for setup apiCore

func WithBearerAuth

func WithBearerAuth(tokenGetter func() string) SdkOpt

WithBearerAuth opt to setup SDK authWriter

func WithPermanentTokenAuth

func WithPermanentTokenAuth(tokenGetter func() string) SdkOpt

WithPermanentTokenAuth opt to setup SDK authWriter

Directories

Path Synopsis
swagger

Jump to

Keyboard shortcuts

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