Documentation ¶
Index ¶
- type JWT
- type Token
- func (t Token) Claims() (value jwt.MapClaims, exists bool)
- func (t Token) Get(key string) (value interface{}, exists bool)
- func (t Token) GetBool(key string) (b bool)
- func (t Token) GetDuration(key string) (d time.Duration)
- func (t Token) GetFloat64(key string) (f64 float64)
- func (t Token) GetInt(key string) (i int)
- func (t Token) GetInt64(key string) (i64 int64)
- func (t Token) GetString(key string) (s string)
- func (t Token) GetStringSlice(key string) (ss []string)
- func (t Token) GetTime(key string) (tm time.Time)
- func (t Token) GetUint(key string) (ui uint)
- func (t Token) GetUint64(key string) (ui64 uint64)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type JWT ¶
type JWT struct {
// contains filtered or unexported fields
}
JWT
func New ¶
func New(privateKey *rsa.PrivateKey, publicKey *rsa.PublicKey) *JWT
New creates a new instance of JWT util
func (JWT) CreatAndSign ¶
CreateAndSign a new jwt token
type Token ¶
func (Token) GetDuration ¶
GetDuration returns the value associated with the key as a duration.
func (Token) GetFloat64 ¶
GetFloat64 returns the value associated with the key as a float64.
func (Token) GetStringSlice ¶
GetStringSlice returns the value associated with the key as a slice of strings.
Click to show internal directories.
Click to hide internal directories.