oss

package
v0.7.8 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

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"
)
View Source
const (
	Region = "cn-shenzhen"
)

Variables

Functions

func CalculateAuthorization

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

CalculateAuthorization calculates authorization for OSS request

func Date

func Date() string

func GetEndpointUrl added in v0.3.2

func GetEndpointUrl() string

func GetPutObjectUrl added in v0.3.2

func GetPutObjectUrl(bucket, key string) string

func ReplaceCallbackSha1 added in v0.7.5

func ReplaceCallbackSha1(callback, fileSha1 string) string

Types

type Callback added in v0.7.5

type Callback struct {
	CallbackUrl  string `json:"callbackUrl"`
	CallbackBody string `json:"callbackBody"`
	// Optional fields
	CallbackHost     *string `json:"callbackHost,omitempty"`
	CallbackSNI      *bool   `json:"callbackSNI,omitempty"`
	CallbackBodyType *string `json:"callbackBodyType,omitempty"`
}

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