Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterImplementor ¶
func RegisterImplementor(token Token)
RegisterImplementor registers the token service implementor.
Types ¶
type Token ¶
type Token interface {
// NewSecretKey creates a new secret key.
NewSecretKey(alg secret.Algorithm) ([]byte, error)
// Generate a new token with specified secret info.
Generate(s *secret.Info) (string, error)
// Refresh the token with expired time renewed.
Refresh(s *secret.Info) (string, error)
// Parse the metadata.
Parse(md *common.Metadata) (*secret.Info, error)
// ParseRaw parses a token string.
ParseRaw(token string) (*secret.Info, error)
}
Token interface.
Click to show internal directories.
Click to hide internal directories.