Documentation ¶
Index ¶
Constants ¶
View Source
const LEN_TOKEN_ID = 36
Variables ¶
View Source
var (
ERR_SIZE_MORE = errors.New("token size is more than 4 kb")
)
Functions ¶
This section is empty.
Types ¶
type Backend ¶
func NewBackendCryptAES ¶
NewBackendCryptAES and returns a new *token.CryptAES. The key argument should be the AES key, either 16, 24, or 32 bytes to select AES-128, AES-192, or AES-256.
func NewBackendJose ¶
func NewBackendJose(cfg *JoseConfig, key SecretKey) (Backend, error)
type BackendCryptAES ¶
type BackendCryptAES struct {
// contains filtered or unexported fields
}
type BackendJose ¶
type BackendJose struct {
// contains filtered or unexported fields
}
type Body ¶
type Body struct { ID string `json:"tok_id"` UpTime int64 `json:"up_time"` CreateTime int64 `json:"cr_time"` *values.Value }
func (Body) MarshalEasyJSON ¶
MarshalEasyJSON supports easyjson.Marshaler interface
func (Body) MarshalJSON ¶
MarshalJSON supports json.Marshaler interface
func (*Body) UnmarshalEasyJSON ¶
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*Body) UnmarshalJSON ¶
UnmarshalJSON supports json.Unmarshaler interface
type Encoder ¶
type Encoder interface { NewToken() *Token UnmarshalString(string) (*Token, error) MarshalString(*Token) (string, error) }
func NewEncoder ¶
type JoseConfig ¶
type StandartEncoder ¶
type StandartEncoder struct {
// contains filtered or unexported fields
}
func (*StandartEncoder) MarshalString ¶
func (e *StandartEncoder) MarshalString(tok *Token) (raw string, err error)
func (*StandartEncoder) NewToken ¶
func (e *StandartEncoder) NewToken() (tok *Token)
func (*StandartEncoder) UnmarshalString ¶
func (e *StandartEncoder) UnmarshalString(str string) (tok *Token, err error)
type Token ¶
type Token struct {
*Body
}
func (*Token) GetTokenCreateTime ¶
func (*Token) GetTokenID ¶
func (*Token) GetTokenUpdateTime ¶
Click to show internal directories.
Click to hide internal directories.