oss

package
v2.0.11 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2024 License: MPL-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultExpireTime = 600

Variables

This section is empty.

Functions

This section is empty.

Types

type AliOss

type AliOss struct {
	AccessKey    string
	AccessSecret string
	Domain       string
	Endpoint     string
}

func New

func New(domain, endpoint, accessKey, accessSecret string) *AliOss

func (*AliOss) GenSignature

func (a *AliOss) GenSignature(dir string) (*OssSignature, error)

GenSignature 生成oss直传token

func (*AliOss) Upload

func (a *AliOss) Upload(bucket, dir, fileName string, data []byte) (string, error)

Upload file

type OssPolicyConfig

type OssPolicyConfig struct {
	Expiration string     `json:"expiration"`
	Conditions [][]string `json:"conditions"`
}

type OssSignature

type OssSignature struct {
	AccessKeyId string
	Host        string
	Expire      int64
	Signature   string
	Directory   string
	Policy      string
}

Jump to

Keyboard shortcuts

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