Documentation ¶
Index ¶
- func Decode(token string, v interface{}) error
- func Gen(params Claims, expMinutes time.Duration) string
- func GenWithSecret(params Claims, secret []byte, expMinutes time.Duration) string
- func Parse(token string) (*jwt.Token, error)
- func ParseWithSecret(token string, secret []byte) (*jwt.Token, error)
- func Test(token string) error
- func TestWithSecret(token string, secret []byte) error
- type Claims
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Decode ¶
Decode accepts a token string and unmarshals the header and payload segments into the given interface{}
func GenWithSecret ¶
GenWithSecret generates a jwt token string from a payload, secret and exp duration
func Parse ¶
Parse does what ParseWithSecret does but gets the signing key from the env var TOKEN_SECRET
func ParseWithSecret ¶
ParseWithSecret attempts to parse a token string given a custom siginin key. Then returns a Token if string/key is valid
func Test ¶
Test does what TestWithSecret does but gets the signing key from the env var TOKEN_SECRET
func TestWithSecret ¶
TestWithSecret verifies a token and returns an error if the token is invalid
Types ¶
Click to show internal directories.
Click to hide internal directories.