ec_storage

package module
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2023 License: MPL-2.0 Imports: 11 Imported by: 1

README

EdgeCenter Storage API Golang SDK

Lint Build and test

The purpose of this project is to cover EdgeCenter Storage API methods related with EdgeCenter Terraform plugin (https://github.com/Edge-Center/terraform-provider-edgecenter).

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.

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 EdgeCenter 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.edgecenter.ru/storage apiHost = https://api.edgecenter.ru apiBasePath = /storage

func (SDK) BucketCORS

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

BucketCORS getter for EdgeCenter Storage API

func (SDK) BucketsList

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

BucketsList getter for EdgeCenter Storage API same result like on UI here https://https://api.edgecenter.ru/storage/bucket/{storageID}

func (SDK) CreateBucket

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

CreateBucket writer for EdgeCenter Storage API

func (SDK) CreateBucketCORS

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

CreateBucketCORS writer for EdgeCenter Storage API

func (SDK) CreateBucketLifecycle

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

CreateBucketLifecycle writer for EdgeCenter Storage API

func (SDK) CreateBucketPolicy

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

CreateBucketPolicy writer for EdgeCenter Storage API

func (SDK) CreateStorage

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

CreateStorage writer for EdgeCenter Storage API

func (SDK) DeleteBucket

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

DeleteBucket writer for EdgeCenter Storage API

func (SDK) DeleteBucketLifecycle

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

DeleteBucketLifecycle writer for EdgeCenter Storage API

func (SDK) DeleteStorage

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

DeleteStorage writer for EdgeCenter Storage API be noticed that delete action is async in ec end service

func (SDK) LocationsList added in v0.2.0

func (sdk SDK) LocationsList(opts ...func(params *locations.LocationListHTTPParams)) ([]models.ClientLocationRes, error)

LocationsList getter for EdgeCenter Storage API

func (SDK) StoragesList

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

StoragesList getter for EdgeCenter Storage API same result like on UI here https://api.edgecenter.ru/storage/list

func (SDK) UpdatestoragesCredentials added in v0.2.0

func (sdk SDK) UpdatestoragesCredentials(
	opts ...func(params *storages.StorageUpdateCredentialsHTTPParams)) (*models.Credentials, error)

UpdateStorageCredentials writer for EdgeCenter 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

func WithUserAgent

func WithUserAgent(agent string) SdkOpt

WithUserAgent opt

Directories

Path Synopsis
swagger

Jump to

Keyboard shortcuts

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