urlsigner

package
v0.0.0-...-0cd45ec Latest Latest
Warning

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

Go to latest
Published: May 12, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Signer

type Signer struct {
	Secret []byte
}

Signer is type which holds secret key for generating signed tokens

func (*Signer) GenerateTokenFromString

func (s *Signer) GenerateTokenFromString(data string) string

GenerateTokenFromString generates an URL signed token

func (*Signer) IsExpired

func (s *Signer) IsExpired(token string, minutesUntilExpire int) bool

IsExpired returns TRUE if expiry date is ok, FALSE otherwise

func (*Signer) VerifyToken

func (s *Signer) VerifyToken(token string) bool

VerifyToken verifies if the URL signed token is valid or not.

Jump to

Keyboard shortcuts

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