Documentation ¶
Index ¶
- type Blacklist
- type File
- type Group
- type Task
- type TaskStatus
- type User
- func (g *User) Authenticate(checkPassword string) error
- func (g *User) BuildFilter() (*User, error)
- func (g *User) BuildUpdate(curUser *User)
- func (g *User) CheckID(chkId string) bool
- func (g *User) HashPassword() error
- func (g *User) LoadScope(scopeUser *User, valCase string)
- func (g *User) Validate(valCase string) (err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Blacklist ¶
type Blacklist struct { Id string `json:"id,omitempty"` AuthToken string `json:"auth_token,omitempty"` LastModified time.Time `json:"last_modified,omitempty"` CreatedAt time.Time `json:"created_at,omitempty"` }
Blacklist is a root struct that is used to store the json encoded data for/from a mongodb blacklist doc.
type File ¶
type File struct { Id string `json:"id,omitempty"` OwnerId string `json:"owner_id,omitempty"` OwnerType string `json:"owner_type,omitempty"` GridFSId string `json:"gridfs_id,omitempty"` BucketName string `json:"bucket_name,omitempty"` BucketType string `json:"bucket_type,omitempty"` Name string `json:"name,omitempty"` FileType string `json:"file_type,omitempty"` Size int `json:"size,omitempty"` LastModified time.Time `json:"last_modified,omitempty"` CreatedAt time.Time `json:"created_at,omitempty"` DeletedAt time.Time `json:"deleted_at,omitempty"` }
File is a root struct that is used to store the json encoded data for/from a mongodb file doc.
func UsersToFiles ¶
UsersToFiles converts an input slice of user to a slice of file
func (*File) BuildBucketName ¶
BuildBucketName returns a current name for the bucket of a GridFS File
func (*File) BuildFilter ¶
BuildFilter is a function that setups the base user struct during a File modification request
func (*File) BuildUpdate ¶
BuildUpdate is a function that setups the base file struct during a file modification request
type Group ¶
type Group struct { Id string `json:"id,omitempty"` Name string `json:"name,omitempty"` RootAdmin bool `json:"root_admin,omitempty"` LastModified time.Time `json:"last_modified,omitempty"` CreatedAt time.Time `json:"created_at,omitempty"` DeletedAt time.Time `json:"deleted_at,omitempty"` }
Group is a root struct that is used to store the json encoded data for/from a mongodb group doc.
type Task ¶
type Task struct { Id string `json:"id,omitempty"` Name string `json:"name,omitempty"` Status TaskStatus `json:"status,omitempty"` Due time.Time `json:"due,omitempty"` Description string `json:"description,omitempty"` UserId string `json:"user_id,omitempty"` GroupId string `json:"group_id,omitempty"` LastModified time.Time `json:"last_modified,omitempty"` CreatedAt time.Time `json:"created_at,omitempty"` DeletedAt time.Time `json:"deleted_at,omitempty"` }
Task is a root struct that is used to store the json encoded data for/from a mongodb group doc.
func (*Task) BuildUpdate ¶
BuildUpdate is a function that setups the base task struct during a user modification request
type TaskStatus ¶
type TaskStatus string
const ( NOTSTARTED TaskStatus = "NOT_STARTED" INPROGRESS TaskStatus = "IN_PROGRESS" COMPLETED TaskStatus = "COMPLETED" )
type User ¶
type User struct { Id string `json:"id,omitempty"` Username string `json:"username,omitempty"` Password string `json:"password,omitempty"` FirstName string `json:"firstname,omitempty"` LastName string `json:"lastname,omitempty"` Email string `json:"email,omitempty"` Role string `json:"role,omitempty"` RootAdmin bool `json:"root_admin,omitempty"` GroupId string `json:"group_id,omitempty"` ImageId string `json:"image_id,omitempty"` LastModified time.Time `json:"last_modified,omitempty"` CreatedAt time.Time `json:"created_at,omitempty"` DeletedAt time.Time `json:"deleted_at,omitempty"` }
User is a root struct that is used to store the json encoded data for/from a mongodb user doc.
func (*User) Authenticate ¶
Authenticate compares an input password with the hashed password stored in the User model
func (*User) BuildFilter ¶
BuildFilter is a function that setups the base user struct during a user modification request
func (*User) BuildUpdate ¶
BuildUpdate is a function that setups the base user struct during a user modification request
func (*User) HashPassword ¶
HashPassword hashes a user password and associates it with the user struct