Documentation ¶
Index ¶
- type Claims
- func (claims *Claims) Del(name string)
- func (claims *Claims) Get(name string) (interface{}, bool)
- func (claims *Claims) GetAudience() (string, error)
- func (claims *Claims) GetBool(name string) (bool, error)
- func (claims *Claims) GetBytes(name string) ([]byte, error)
- func (claims *Claims) GetExpiration() (time.Time, error)
- func (claims *Claims) GetFloat64(name string) (float64, error)
- func (claims *Claims) GetIssuedAt() (time.Time, error)
- func (claims *Claims) GetIssuer() (string, error)
- func (claims *Claims) GetJTI() (string, error)
- func (claims *Claims) GetNotBefore() (time.Time, error)
- func (claims *Claims) GetPrincipal() (string, error)
- func (claims *Claims) GetString(name string) (string, error)
- func (claims *Claims) GetTime(name string) (time.Time, error)
- func (claims *Claims) GetType() (string, error)
- func (claims *Claims) Has(name string) bool
- func (claims *Claims) Keys() []string
- func (claims *Claims) Len() int
- func (claims *Claims) Marshal() ([]byte, error)
- func (claims *Claims) Set(name string, value interface{})
- func (claims *Claims) SetAudience(aud string)
- func (claims *Claims) SetExpiration(exp time.Time)
- func (claims *Claims) SetIssuedAt(iat time.Time)
- func (claims *Claims) SetIssuer(iss string)
- func (claims *Claims) SetJTI(jti string)
- func (claims *Claims) SetNotBefore(nbf time.Time)
- func (claims *Claims) SetPrincipal(prn string)
- func (claims *Claims) SetType(typ string)
- func (claims *Claims) Unmarshal(bytes []byte) error
- type Header
- func (header *Header) Del(name string)
- func (header *Header) Get(name string) (interface{}, bool)
- func (header *Header) GetBool(name string) (bool, error)
- func (header *Header) GetBytes(name string) ([]byte, error)
- func (header *Header) GetFloat64(name string) (float64, error)
- func (header *Header) GetString(name string) (string, error)
- func (header *Header) GetTime(name string) (time.Time, error)
- func (header *Header) Has(name string) bool
- func (header *Header) Keys() []string
- func (header *Header) Len() int
- func (header *Header) Marshal() ([]byte, error)
- func (header *Header) Set(name string, value interface{})
- func (header *Header) Unmarshal(bytes []byte) error
- type JWT
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Claims ¶
type Claims struct {
// contains filtered or unexported fields
}
Claims represents a JWT claims section.
func (*Claims) GetAudience ¶
GetAudience gets the audience for the Claims.
func (*Claims) GetExpiration ¶
GetExpiration gets the expiration timestamp for the Claims.
func (*Claims) GetFloat64 ¶
GetFloat64 Gets a float64 value in the Claims given by name.
func (*Claims) GetIssuedAt ¶
GetIssuedAt gets the issued at timestamp for the Claims.
func (*Claims) GetNotBefore ¶
GetNotBefore gets the not before timestamp for the Claims.
func (*Claims) GetPrincipal ¶
GetPrincipal gets the principal for the Claims.
func (*Claims) SetAudience ¶
SetAudience sets the audience for the Claims.
func (*Claims) SetExpiration ¶
SetExpiration sets the expiration timestamp for the Claims.
func (*Claims) SetIssuedAt ¶
SetIssuedAt sets the issued at timestamp for the Claims.
func (*Claims) SetNotBefore ¶
SetNotBefore sets the not before timestamp for the Claims.
func (*Claims) SetPrincipal ¶
SetPrincipal sets the principal for the Claims.
type Header ¶
type Header struct {
// contains filtered or unexported fields
}
Header represents a JWT header object.
func (*Header) GetFloat64 ¶
GetFloat64 Gets a float64 value in the Header given by name.
type JWT ¶
JWT Represents a JSON Web Token. A JWT contain a Header and Claims.
func NewJWT ¶
func NewJWT() *JWT
NewJWT Creates a new JWT. The token contains the typ and alg header. The only supported algorithm is HS256 or HMAC SHA256.