cloudos

package
v5.1.11-release+incomp... Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2020 License: LGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrUnsupportedS3Provider -
	ErrUnsupportedS3Provider = errors.New("unsupported s3 provider")
)

Functions

This section is empty.

Types

type CloudOSer

type CloudOSer interface {
	PutObject(objkey, filepath string) error
	GetObject(objectKey, filePath string) error
	DeleteObject(objkey string) error
}

CloudOSer is the interface that wraps the required methods to interact with cloud object storage.

func New

func New(cfg *Config) (CloudOSer, error)

New returns a new CloudOSer.

type Config

type Config struct {
	ProviderType S3Provider

	Endpoint  string
	AccessKey string
	SecretKey string
	UseSSL    bool

	BucketName string
	Location   string
}

Config configuration about cloud object storage.

type S3Provider

type S3Provider string

S3Provider -

var (
	// S3ProviderS3 -
	S3ProviderS3 S3Provider = "s3"
	// S3ProviderAliOSS -
	S3ProviderAliOSS S3Provider = "alioss"
)

func Str2S3Provider

func Str2S3Provider(value string) (S3Provider, error)

Str2S3Provider converts a string to S3Provider.

func (S3Provider) String

func (p S3Provider) String() string

type S3SDKError

type S3SDKError struct {
	Code       string // The error code returned from S3 to the caller
	Message    string // The detail error message from S3
	RawMessage string // The raw messages from S3
	StatusCode int    // HTTP status code
}

S3SDKError -

func (S3SDKError) Error

func (e S3SDKError) Error() string

Error implements interface error

Jump to

Keyboard shortcuts

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