Documentation ¶
Index ¶
Constants ¶
View Source
const (
Collection = "users"
)
Variables ¶
View Source
var ( // ErrNotFound is used when a specific User is requested but does not exist. ErrNotFound = errors.New("not found") // ErrInvalidID occurs when an ID is not in a valid form. ErrInvalidID = errors.New("ID is not in its proper form") // ErrAuthenticationFailure occurs when a user attempts to authenticate but // anything goes wrong. ErrAuthenticationFailure = errors.New("authentication failed") // ErrForbidden occurs when a user tries to do something that is forbidden to them according to our access control policies. ErrForbidden = errors.New("attempted action is not allowed") )
Functions ¶
This section is empty.
Types ¶
type Info ¶
type Info struct { ID primitive.ObjectID `bson:"_id"` Name string `bson:"name,omitempty" json:"name"` Slug string `bson:"slug,omitempty" json:"slug"` Roles []string `bson:"roles" json:"roles"` Email string `bson:"email" json:"email"` PasswordHash []byte `bson:"password_hash" json:"-"` Description string `bson:"description,omitempty" json:"description"` CreatedAt time.Time `bson:"created_at,omitempty" json:"created_at"` }
type NewUser ¶
type NewUser struct { Name string `json:"name" validate:"required"` Description string `json:"description"` Email string `json:"email" validate:"required,email"` Roles []string `json:"roles" validate:"required"` Password string `json:"password" validate:"required"` PasswordConfirm string `json:"password_confirm" validate:"eqfield=Password"` }
Click to show internal directories.
Click to hide internal directories.