Documentation ¶
Overview ¶
Package token provides a simple type for functions that generate tokens
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FromContext ¶
FromContext returns token from the incoming context metadata.
func NewPerRPCCredentials ¶
func NewPerRPCCredentials(genTokenFunc GeneratorFunc) credentials.PerRPCCredentials
NewPerRPCCredentials creates credentials.PerRPCCredentials based on token generator func
Types ¶
type GeneratorFunc ¶
type GeneratorFunc func(peerAuthInfo credentials.AuthInfo) (token string, expireTime time.Time, err error)
GeneratorFunc - a function which takes the credentials.AuthInfo of the peer of the client or server
and returns a token as a string (example: JWT), a expireTime, and an error.
Click to show internal directories.
Click to hide internal directories.