oss

package
v1.0.30 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2023 License: BSD-3-Clause Imports: 23 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoSuchKey = fmt.Errorf("no such key")

Functions

func Unwrap added in v1.0.5

func Unwrap(err error) error

Types

type AliOSSConfig

type AliOSSConfig struct {
	Endpoint  string `json:"endpoint"`
	AccessKey string `json:"accessKey"`
	SecretKey string `json:"secretKey"`
	Bucket    string `json:"bucket"`
	BaseURL   string `json:"baseURL"`
}

type AwsOSSConfig added in v1.0.5

type AwsOSSConfig struct {
	Region    string `json:"region"`
	AccessKey string `json:"accessKey"`
	SecretKey string `json:"secretKey"`
	Bucket    string `json:"bucket"`
	BaseURL   string `json:"baseURL"`
}

type LevelDBConfig

type LevelDBConfig struct {
	Dir string `json:"dir"`
}

type OSS

type OSS interface {
	micro.Recycle
	Get(key string) ([]byte, error)
	GetURL(key string) string
	GetSignURL(key string, expires time.Duration) (string, error)
	Put(key string, data []byte, header map[string]string) error
	PutSignURL(key string, expires time.Duration, header map[string]string) (string, error)
	PostSignURL(key string, expires time.Duration, maxSize int64, header map[string]string) (string, map[string]string, error)
	Del(key string) error
	Has(key string) (bool, error)
}

func GetOSS

func GetOSS(ctx micro.Context, name string) (OSS, error)

func NewAliOSS

func NewAliOSS(cfg *AliOSSConfig) (OSS, error)

func NewAwsOSS added in v1.0.5

func NewAwsOSS(cfg *AwsOSSConfig) (OSS, error)

func NewLevelDB

func NewLevelDB(cfg *LevelDBConfig) (OSS, error)

type OSSService

type OSSService interface {
	micro.Service
	OSS() OSS
}

Jump to

Keyboard shortcuts

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