signer

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: May 26, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SignatureQueryParameter = "sig"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Signer

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

func New

func New(key string) *Signer

func (*Signer) SignURL

func (signer *Signer) SignURL(u url.URL) url.URL

SignURL adds a sha256 hmac signature to a URL as a query parameter.

func (*Signer) SignURLWithTTL added in v0.3.0

func (signer *Signer) SignURLWithTTL(u url.URL, ttl time.Duration) (url.URL, time.Time)

SignURLWithTTL adds a sha256 hmac signature to a URL with a ttl.

func (*Signer) VerifyURL

func (signer *Signer) VerifyURL(u url.URL) bool

VerifyURL checks if the URL has a valid signature.

func (*Signer) VerifyURLAndNotExpired added in v0.3.0

func (signer *Signer) VerifyURLAndNotExpired(u url.URL) bool

VerifyURLAndNotExpired checks if the URL has a valid signature and has not expired.

Jump to

Keyboard shortcuts

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