auth

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateQiniuToken

func GenerateQiniuToken(accessKey, secretKey string, req QiniuAuthRequest) (string, error)

GenerateQiniuToken generates a Qiniu authentication token accessKey: Qiniu Access Key secretKey: Qiniu Secret Key req: Authentication request parameters Return: QiniuToken string, in the format of "Qiniu AccessKey:encodedSign"

Types

type QiniuAuthRequest

type QiniuAuthRequest struct {
	Method      string // HTTP method, supports POST, PUT, GET, must be in all uppercase
	Path        string // Request path
	RawQuery    string // URL query parameters (excluding ?)
	Host        string // Request domain name, for example: atlab.ai
	ContentType string // Request content type, optional
	Body        []byte // Request Body, optional
}

QiniuAuthRequest qiniu authorization request

func BuildQiniuAuthRequest

func BuildQiniuAuthRequest(method, path, host string) *QiniuAuthRequest

BuildQiniuAuthRequest build QiniuAuthRequest

func (*QiniuAuthRequest) SetBody

func (r *QiniuAuthRequest) SetBody(body []byte) *QiniuAuthRequest

SetBody set Body

func (*QiniuAuthRequest) SetBodyString

func (r *QiniuAuthRequest) SetBodyString(bodyStr string) *QiniuAuthRequest

SetBodyString set Body

func (*QiniuAuthRequest) SetContentType

func (r *QiniuAuthRequest) SetContentType(contentType string) *QiniuAuthRequest

SetContentType set ContentType

func (*QiniuAuthRequest) SetRawQuery

func (r *QiniuAuthRequest) SetRawQuery(rawQuery string) *QiniuAuthRequest

SetRawQuery set RawQuery

Jump to

Keyboard shortcuts

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