Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Enroll ¶
func Enroll(userID string, options ...EnrollmentOption) error
Enroll generates msp.SigningIdentity for user and confirms one.
Types ¶
type EnrollOptionFunc ¶
type EnrollOptionFunc func(*enrollArgs)
EnrollOptionFunc is a function that mutates model during Enroll execution.
func (EnrollOptionFunc) Apply ¶
func (f EnrollOptionFunc) Apply(args *enrollArgs)
Apply calls EnrollOptionFunc on model.
type EnrollmentOption ¶
type EnrollmentOption interface {
Apply(*enrollArgs)
}
EnrollmentOption allows passing parameters for Enroll method.
func WithExpiration ¶
func WithExpiration(expireAt time.Time) EnrollmentOption
WithExpiration creates user with given `expireAt`.
func WithExpirationPb ¶
func WithExpirationPb(expireAt *timestamppb.Timestamp) EnrollmentOption
WithExpirationPb creates user with given `expireAt`.
func WithRole ¶
func WithRole(role string) EnrollmentOption
WithRole creates user with given `role`.
type RegisterOptionFunc ¶
RegisterOptionFunc is a function that mutates model during Register execution.
func (RegisterOptionFunc) Apply ¶
func (f RegisterOptionFunc) Apply(user *model.User)
Apply calls RegisterOptionFunc on model.
type RegistrationOption ¶
RegistrationOption allows passing parameters for Register method.
func WithEmail ¶
func WithEmail(email string) RegistrationOption
WithEmail creates user with given `email`.
func WithName ¶
func WithName(firstname, lastname string) RegistrationOption
WithName creates user with given `firstname` and `lastname`.