Documentation
¶
Index ¶
- Constants
- func CreateToken(subject *data.TokenClaimsSubject) (tokenString string, err error)
- func FromJSON(i interface{}, r io.Reader) error
- func FromJSONString(data string, i interface{}) error
- func GetIntervalString(from time.Time, to time.Time) string
- func GetNextID() (uint64, error)
- func MustGetNextID() uint64
- func NewUUID() string
- func ParseToken(tokenString string) (subject *data.TokenClaimsSubject, err error)
- func RefreshToken(tokenString string) (newToken string, success bool)
- func ToJSON(i interface{}, w io.Writer) error
- func ToJSONString(i interface{}) (string, error)
Constants ¶
View Source
const WorkerID = 10
WorkerID worker
Variables ¶
This section is empty.
Functions ¶
func CreateToken ¶
func CreateToken(subject *data.TokenClaimsSubject) (tokenString string, err error)
CreateToken 创建token
func FromJSONString ¶
FromJSONString 反序列化json数据
func GetIntervalString ¶
GetIntervalString 获取两个时间间隔
func ParseToken ¶
func ParseToken(tokenString string) (subject *data.TokenClaimsSubject, err error)
ParseToken 解析json数据
func RefreshToken ¶
RefreshToken 刷新token 如果过期时间小于expiredTime*0.2 那么就刷新Token
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.