Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ModifyOrganization ¶
func ModifyOrganization(name string, organization Organization) error
ModifyOrganization modify organization
func RemoveOrganization ¶
RemoveOrganization remove organization
Types ¶
type Organization ¶
type Organization struct {
Name string `json:"name" bson:"_id"`
Teams []Team `json:"teams" bson:"teams"`
Admins []string `json:"admins" bson:"admins"`
}
Organization holds its name, teams and admins
func DetailOrganization ¶
func DetailOrganization(name string) (Organization, error)
DetailOrganization detail organization
func NewOrganization ¶
func NewOrganization(organization Organization) (Organization, error)
NewOrganization create new organization
type OrganizationList ¶
type OrganizationList []Organization
OrganizationList holds a list of organization
func ListOrganizations ¶
func ListOrganizations() (OrganizationList, error)
ListOrganizations list organizations
type Team ¶
type Team struct {
Name string `json:"name" bson:"name"`
Users []string `json:"users" bson:"users"`
}
Team holds its name and users list
type User ¶
type User struct {
Name string `bson:"name"`
Email string `bson:"_id"`
Password string `bson:"password"`
APIKey string `bson:"apikey"`
Created time.Time `bson:"created"`
LastLogin time.Time `bson:"lastlogin"`
}
User represent a system user
func GetUserByAPIKey ¶
GetUserByAPIKey find user by APIKey
func GetUserByEmail ¶
GetUserByEmail find user by Email
func (*User) EncryptPassword ¶
func (u *User) EncryptPassword()
EncryptPassword before store on DB encrypt user password
func (*User) ValidateEmail ¶
ValidateEmail check if email is valid
func (*User) ValidatePassword ¶
ValidatePassword check if password is valid
Click to show internal directories.
Click to hide internal directories.