Documentation
¶
Index ¶
Constants ¶
View Source
const ( PermUserGroup = "add users and groups" PermUserProperties = "manage most users properties" PermUserManage = "create and manage user views" PermUserUpdatePassword = "update password expiration policies" PermServiceRequest = "manage service requests" PermReadWrite = "readWrite" PermResetPassword = "resetPassword" PermListEmployee = "listEmployee" PermAttendance = "readWriteAttendance" PermUserDetails = "readUpdateUserDetails" )
Variables ¶
View Source
var DeleteCookie = &http.Cookie{ Name: "token", Value: "", Path: "/", Expires: time.Now().Add(0), }
Functions ¶
This section is empty.
Types ¶
type AccessControl ¶
type AccountDetail ¶
type AccountDetail struct { ID string `json:"id" gorm:"type:varchar(50);primaryKey"` JobTitle string `json:"job_title" gorm:"type:text;not null"` Level string `json:"level" gorm:"type:text;not null"` Phone string `json:"phone" gorm:"type:text;not null"` Address string `json:"address" gorm:"type:text;not null"` StartContract time.Time `json:"start_contract" gorm:"not null;"` EndContract time.Time `json:"end_contract" gorm:"not null;"` AccountID string `json:"-" gorm:"type:varchar(50)"` }
type AccountRepository ¶
type AccountRepository interface { Store(adminID, roleName string, in *RegisterInput) error FindUsername(username string) (*Accounts, error) FindID(id string) (*Accounts, error) GetAccount(adminID string, roleName string) ([]Accounts, error) DeleteAccount(id string, username string) error CheckRole(adminID string, roleName string) error GivenPermission(userId string, roleName string, permName string) error AssignAccessControl(adminID string, roleName string, control *AssignRole) error AccessControlList() (AccessControl, error) SetOnlineStatus(id string, status bool) error GetOnlineStatus(Id string) ([]*Accounts, error) }
type Accounts ¶
type Accounts struct { ID string `json:"id" gorm:"type:varchar(50);primaryKey"` Name string `json:"name" gorm:"type:varchar(50);not null"` Username string `json:"username" gorm:"type:varchar(24);not null"` Password string `json:"-" gorm:"type:text;not null"` SecretPassword string `json:"-" gorm:"type:text;not null"` Email string `json:"email" gorm:"type:varchar(80);not null"` OnlineStatus bool `json:"online_status" gorm:"default:false"` SuspendStatus bool `json:"suspend_status" gorm:"default:false"` CreatedAt time.Time `json:"created_at" gorm:"not null;"` UpdatedAt time.Time LastLogin time.Time `json:"last_login" gorm:"not null;"` Accounts AccountDetail `json:"-" gorm:"ForeignKey:AccountID"` Trello Trello `json:"-" gorm:"ForeignKey:AccountID"` }
type AssignRole ¶
type AssignRole struct { UserID string `json:"userID"` Role string `json:"role"` Permission string `json:"permission"` Errors map[string]string `json:"-"` }
func (*AssignRole) Validate ¶
func (m *AssignRole) Validate() bool
type AuthRepository ¶
type DashboardContent ¶
type LoginInput ¶
type LoginInput struct { Username string Password string Errors map[string]string Token string LongToken bool }
func (*LoginInput) ComparePassword ¶
func (m *LoginInput) ComparePassword(hashed string, secret string) bool
func (*LoginInput) GenerateJwt ¶
func (m *LoginInput) GenerateJwt(data map[string]interface{}) (string, error)
func (*LoginInput) RefreshJwt ¶
func (m *LoginInput) RefreshJwt(oldToken string) (string, error)
func (*LoginInput) Validate ¶
func (m *LoginInput) Validate() bool
type Performance ¶
type RegisterInput ¶
type RegisterInput struct { Name string `json:"name"` Email string `json:"email"` Username string `json:"username"` Password string `json:"password"` Errors map[string]string `json:"-"` Token string }
func (*RegisterInput) GeneratePassword ¶
func (m *RegisterInput) GeneratePassword(secret string) (string, error)
func (*RegisterInput) ValidateAPI ¶
func (m *RegisterInput) ValidateAPI() bool
type Trello ¶
type Trello struct { ID uint64 `json:"id" gorm:"primary_key"` BoardName string `json:"board_name" gorm:"type:varchar(50);not null"` BoardID string `json:"board_id" gorm:"type:varchar(50);not null"` CardMemberID string `json:"-" gorm:"type:varchar(120);null;index:card_member_id_id_k"` AccountID string `json:"-" gorm:"type:varchar(50);null"` CardItems []TrelloUserCard `json:"card_items" gorm:"ForeignKey:CardMemberID;references:CardMemberID"` }
type TrelloRepository ¶
type TrelloRepository interface { Store(in *TrelloUserCard) (*TrelloUserCard, error) FindCardCategory(id string, category string) (int, error) }
type TrelloUserCard ¶
type TrelloUserCard struct { gorm.Model CardID string `json:"card_id" gorm:"type:varchar(120);not null"` CardName string `json:"card_name" gorm:"type:text;not null"` CardCategory string `json:"card_category" gorm:"type:varchar(120);not null"` CardVotes int64 `json:"card_votes" gorm:"type:int(12);not null"` CardCheckItems int64 `json:"card_check_items" gorm:"type:int(12);not null"` CardCheckLists int64 `json:"card_check_lists" gorm:"type:int(12);not null"` CardCommentCount int64 `json:"comment_count" gorm:"type:int(12);not null"` CardAttachmentsCount int64 `json:"attachments_count" gorm:"type:int(12);not null"` CardCheckItemsComplete int64 `json:"card_check_items_complete" gorm:"type:int(12);not null"` CardCheckItemsInComplete int64 `json:"card_check_items_incomplete" gorm:"type:int(12);not null"` CardUrl string `json:"card_url" gorm:"type:text;not null"` CardMemberID string `json:"card_member_id" gorm:"type:varchar(120);not null"` CardMemberName string `json:"card_member_name" gorm:"type:text;not null"` CardMemberUsername string `json:"card_member_username" gorm:"type:text;not null"` CardCreatedAt time.Time `json:"card_created_at" gorm:"not null;"` }
func (TrelloUserCard) TableName ¶
func (TrelloUserCard) TableName() string
Click to show internal directories.
Click to hide internal directories.