add Name to auth.Account as a user friendly alias (#1992)
* add Name to auth.Account as a user friendly alias
This commit is contained in:
@@ -110,6 +110,8 @@ type GenerateOptions struct {
|
||||
Secret string
|
||||
// Issuer of the account, e.g. micro
|
||||
Issuer string
|
||||
// Name of the acouunt e.g. an email or username
|
||||
Name string
|
||||
}
|
||||
|
||||
type GenerateOption func(o *GenerateOptions)
|
||||
@@ -156,6 +158,13 @@ func WithIssuer(i string) GenerateOption {
|
||||
}
|
||||
}
|
||||
|
||||
// WithName for the generated account
|
||||
func WithName(n string) GenerateOption {
|
||||
return func(o *GenerateOptions) {
|
||||
o.Name = n
|
||||
}
|
||||
}
|
||||
|
||||
// NewGenerateOptions from a slice of options
|
||||
func NewGenerateOptions(opts ...GenerateOption) GenerateOptions {
|
||||
var options GenerateOptions
|
||||
|
Reference in New Issue
Block a user