user

package
v0.0.0-...-9d76aac Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 20, 2021 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EnrollmentRequest

type EnrollmentRequest struct {
	// User's unique identifier
	UserID string `json:"user_id" validate:"required,uuid" example:"f4bc94f1-3af4-4ae0-9330-19d86ca42b30"`
	// Role of the user
	Role string `json:"role" validate:"required" example:"admin"`
	// Date of user's contract expiration if defined
	ExpireAt *time.Time `json:"expire_at,omitempty" example:"2006-01-02T15:04:05Z07:00"`
}

EnrollmentRequest defines structure of the request to enroll new User.

type RegistrationRequest

type RegistrationRequest struct {
	// First name of the user
	Firstname string `json:"firstname" validate:"required" example:"John"`
	// Last name of the user
	Lastname string `json:"lastname" validate:"required" example:"Smith"`
	// Email address of the user
	Email string `json:"email" validate:"required,email" example:"[email protected]"`
}

RegistrationRequest defines structure of the request to register new User.

type User

type User struct {
	// User's unique identifier
	ID string `json:"id" bson:"id" example:"f4bc94f1-3af4-4ae0-9330-19d86ca42b30"`
	// User's enrollment identifier
	EnrollmentSecret string `json:"-" bson:"enrollment_id"`
	// First name of the user
	Firstname string `json:"firstname" bson:"firstname" example:"John"`
	// Last name of the user
	Lastname string `json:"lastname" bson:"lastname" example:"Smith"`
	// Email address of the user
	Email string `json:"email" bson:"email" example:"[email protected]"`
	// Role of the user
	Role string `json:"role,omitempty" bson:"role,omitempty" example:"admin"`
	// User initial registration date and time
	CreatedAt time.Time `json:"created_at" bson:"created_at" example:"2021-01-02T15:04:05Z07:00"`
	// User is confirmed by admin.
	Confirmed bool `json:"confirmed" bson:"confirmed"`
	// Date of user's contract expiration if defined
	ExpireAt *time.Time `json:"expire_at,omitempty" bson:"expire_at,omitempty" example:"2021-05-02T15:04:05Z07:00"`
}

User defines structure of user model.

func (*User) IdentityName

func (u *User) IdentityName() string

IdentityName forms the unique name of user's identity.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL