rainbond: github.com/goodrain/rainbond/builder/cloudos Index | Files

package cloudos

import "github.com/goodrain/rainbond/builder/cloudos"


Package Files

alioss.go cloudos.go errors.go s3.go


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

type CloudOSer Uses

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 Uses

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

New returns a new CloudOSer.

type Config Uses

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 Uses

type S3Provider string

S3Provider -

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

func Str2S3Provider Uses

func Str2S3Provider(value string) (S3Provider, error)

Str2S3Provider converts a string to S3Provider.

func (S3Provider) String Uses

func (p S3Provider) String() string

type S3SDKError Uses

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 Uses

func (e S3SDKError) Error() string

Error implements interface error

Package cloudos imports 10 packages (graph) and is imported by 1 packages. Updated 2019-11-15. Refresh now. Tools for package owners.