oss

package
v0.0.0-...-8066787 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2024 License: Apache-2.0, MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitFromCfg

func InitFromCfg(cfg config.OssConfig) error

Types

type AliSTS

type AliSTS interface {
	GetStsToken(sn string) (*StsTokenInfo, error)
}

func NewSts

func NewSts(endpoint, id, secret, arn string) AliSTS

type Option

type Option func(*ossAPI)

type OssAPI

type OssAPI interface {
	SignUrl(bucket, objectKey string, expire int64) (string, error)
	Upload(bucket, obj string, buf io.Reader) error
}
var (
	OssInstance OssAPI
)

func NewMustOssAPI

func NewMustOssAPI(endpint, id, secret string) OssAPI

type StsTokenInfo

type StsTokenInfo struct {
	StatusCode      int    `json:"StatusCode"`
	AccessKeyId     string `json:"AccessKeyId"`
	AccessKeySecret string `json:"AccessKeySecret"`
	SecurityToken   string `json:"SecurityToken"`
	Expiration      string `json:"Expiration"`
}

Jump to

Keyboard shortcuts

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