oss

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: May 20, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RegionId = "oss-cn-shenzhen"
	Endpoint = "oss-cn-shenzhen.aliyuncs.com"
)
View Source
const (
	HeaderAuthorization = "Authorization"
	HeaderDate          = "Date"

	HeaderContentLength = "Content-Length"
	HeaderContentType   = "Content-Type"
	HeaderContentMd5    = "Content-MD5"

	HeaderOssCallback      = "X-OSS-Callback"
	HeaderOssCallbackVar   = "X-OSS-Callback-Var"
	HeaderOssSecurityToken = "X-OSS-Security-Token"
)

Variables

Functions

func CalculateAuthorization

func CalculateAuthorization(metadata *RequestMetadata, keyId string, keySecret string) string

CalculateAuthorization calculates authorization for OSS request

func Date

func Date() string

Types

type Pair

type Pair struct {
	First string
	Last  string
}

type Pairs

type Pairs []*Pair

func (Pairs) Len

func (h Pairs) Len() int

func (Pairs) Less

func (h Pairs) Less(i, j int) bool

func (Pairs) Swap

func (h Pairs) Swap(i, j int)

type RequestMetadata

type RequestMetadata struct {
	// Request verb
	Verb string
	// Request header
	Header map[string]string
	// OSS bucket name
	Bucket string
	// OSS object name
	Object string
	// OSS Parameters
	Params map[string]string
}

Jump to

Keyboard shortcuts

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