auth

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Bits is the number of bits in a UUID
	Bits = 128

	// Size is the number of bytes in a UUID
	Size = Bits / 8
)

Variables

View Source
var (
	// Loggerf can be used to override the default logging destination. Such
	// log messages in this library should be logged at warning or higher.
	Loggerf = func(format string, args ...interface{}) {}
)

Functions

This section is empty.

Types

type URLSigner

type URLSigner struct {
	// contains filtered or unexported fields
}

An URLSigner provides URL signing utilities to sign URLs for Aliyun CDN resources. authentication document: https://help.aliyun.com/document_detail/85117.html

func NewURLSigner

func NewURLSigner(authType string, privKey string) *URLSigner

NewURLSigner returns a new signer object.

func (URLSigner) Sign

func (s URLSigner) Sign(uri string, expires time.Time) (string, error)

Sign returns a signed aliyuncdn url based on authentication type

type UUID

type UUID [Size]byte

UUID represents a UUID value. UUIDs can be compared and set to other values and accessed by byte.

func GenerateUUID

func GenerateUUID() (u UUID)

GenerateUUID creates a new, version 4 uuid.

func (UUID) String

func (u UUID) String() string

Jump to

Keyboard shortcuts

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