auth

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: May 7, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Authorization Authorization
	Authorization = "Authorization"
	// AuthVersion 授权版本
	AuthVersion = "bce-auth-v1"
	// JoinSigncanonicalHeaders sign关联符号
	JoinSigncanonicalHeaders = "\n"
	// JoinSign sign关联符号
	JoinSign = "/"
	// JoinSignHeaders 分隔符
	JoinSignHeaders = ";"
	// DefaultExpireSeconds 默认过期时间
	DefaultExpireSeconds = 1800

	Get     HttpMethod = http.MethodGet
	Head    HttpMethod = http.MethodHead
	Post    HttpMethod = http.MethodPost
	Put     HttpMethod = http.MethodPut
	Patch   HttpMethod = http.MethodPatch
	Delete  HttpMethod = http.MethodDelete
	Connect HttpMethod = http.MethodConnect
	Options HttpMethod = http.MethodOptions
	Trace   HttpMethod = http.MethodTrace
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Auth

type Auth struct {
	AK         string
	SK         string
	Expire     int
	Header     map[string]string
	Path       string
	Param      interface{}
	QueryParam map[string]string
	CustomTS   string
}

Auth Auth

func NewAuth

func NewAuth(ak, sk string) *Auth

NewAuth set ak,sk

func (*Auth) Sign

func (a *Auth) Sign(method HttpMethod) string

Sign generate the authorization string

type HttpMethod added in v1.0.1

type HttpMethod string

func (HttpMethod) String added in v1.0.1

func (h HttpMethod) String() string

String 2String

Jump to

Keyboard shortcuts

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