Documentation
¶
Index ¶
- Variables
- func Encode(header *Header, payload interface{}, key []byte) (token []byte, err error)
- func EncodeToString(header *Header, payload interface{}, key []byte) (token string, err error)
- func GenerateBytes() (data []byte, err error)
- func NewKey(data []byte) (key []byte)
- func NewKeyWithString(data string) []byte
- type Header
- func (h *Header) ActivateAfter(t time.Duration) *Header
- func (h *Header) Duration(t time.Duration) *Header
- func (h *Header) IsActivity() bool
- func (h *Header) IsExpired() bool
- func (h *Header) SetAudience(v string) *Header
- func (h *Header) SetExpiration(t time.Time) *Header
- func (h *Header) SetExtra(v interface{}) *Header
- func (h *Header) SetId(id string) *Header
- func (h *Header) SetIssuer(v string) *Header
- func (h *Header) SetNotBefore(t time.Time) *Header
- func (h *Header) SetSigner(s SignType) *Header
- func (h *Header) SetSubject(v string) *Header
- type Map
- type SignType
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func EncodeToString ¶
func GenerateBytes ¶
func NewKeyWithString ¶
Types ¶
type Header ¶
type Header struct { NoChange string `json:"typ"` Signer SignType `json:"alg"` IssuedAt time.Time `json:"isa"` Id string `json:"jti,omitempty"` Expiration *time.Time `json:"exp,omitempty"` NotBefore *time.Time `json:"nbf,omitempty"` Issuer string `json:"iss,omitempty"` Audience string `json:"aud,omitempty"` Subject string `json:"sub,omitempty"` Extra interface{} `json:"ext,omitempty"` }
func DecodeString ¶
func (*Header) IsActivity ¶
func (*Header) SetAudience ¶
func (*Header) SetSubject ¶
Click to show internal directories.
Click to hide internal directories.