Versions in this module Expand all Collapse all v1 v1.0.0 Mar 11, 2026 Changes in this version + func Decode[T IPayload](bs []byte, secret []byte, payload T) error + func Encode[T IPayload](payload T, secret []byte) []byte + type Header struct + Algorithm string + Typ string + type IOpt func(j *JWT[T]) + type IPayload interface + Decode func([]byte) error + Encode func() []byte + type JWT struct + func New[T IPayload](secret []byte, opts ...IOpt[T]) *JWT[T] + func (j *JWT[T]) Decode(bs []byte, pl T) error + func (j *JWT[T]) Encode(pl T) []byte + func (j *JWT[T]) Header() Header + func (j *JWT[T]) SetHeader(h Header) + type User struct + Expired int64 + Name string + Uid int64 + func (u *User) Decode(bs []byte) error + func (u *User) Encode() []byte