Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrNotFound is returned when a token cannot be found ErrNotFound = errors.New("token not found") // ErrEncodingToken is returned when the service encounters an error during encoding ErrEncodingToken = errors.New("error encoding the token") // ErrInvalidToken is returned when the token provided is not valid ErrInvalidToken = errors.New("invalid token provided") )
Functions ¶
func WithMetadata ¶
func WithMetadata(md map[string]string) func(o *GenerateOptions)
WithMetadata for the token
func WithNamespace ¶
func WithNamespace(n string) func(o *GenerateOptions)
WithNamespace for the token
Types ¶
type GenerateOption ¶
type GenerateOption func(o *GenerateOptions)
func WithExpiry ¶
func WithExpiry(d time.Duration) GenerateOption
WithExpiry for the generated account's token expires
type GenerateOptions ¶
type GenerateOptions struct { // Expiry for the token Expiry time.Duration // Metadata associated with the account Metadata map[string]string // Roles/scopes associated with the account Roles []string // Namespace the account belongs too Namespace string }
func NewGenerateOptions ¶
func NewGenerateOptions(opts ...GenerateOption) GenerateOptions
NewGenerateOptions from a slice of options
type Option ¶
type Option func(o *Options)
func WithPrivateKey ¶
WithPrivateKey sets the JWT private key
Click to show internal directories.
Click to hide internal directories.