Documentation ¶ Index ¶ Variables func Decode(user *UserClaims) (string, error) func Expire(d int) option func Set(secret string, os ...option) type UserClaims func Encode(tokenString string) (*UserClaims, error) Constants ¶ This section is empty. Variables ¶ View Source var ( ErrSecretInvalid = errors.New("the secret not be empty.") ErrTokenExpired = errors.New("token has expired.") ErrTokenInvalid = errors.New("invalid token") ) Functions ¶ func Decode ¶ func Decode(user *UserClaims) (string, error) Decode . func Expire ¶ func Expire(d int) option Expire . func Set ¶ func Set(secret string, os ...option) Set . Types ¶ type UserClaims ¶ type UserClaims struct { ID string } UserClaims . func Encode ¶ func Encode(tokenString string) (*UserClaims, error) Encode . Source Files ¶ View all Source files jwt.go Click to show internal directories. Click to hide internal directories.