Documentation ¶
Index ¶
- Variables
- func APIAuthentication(c *gin.Context)
- func ChangePassword(pid, old_password, password string) (err error)
- func CheckTimeout(session *LoggedSession)
- func CountAllGroup() (count int, err error)
- func CountAllOnlineSession() (count int, err error)
- func CountAllUser() (count int, err error)
- func CreateGroup(data ent.Groups) (res *ent.Groups, err error)
- func CreateGroupBandwidth(data ent.GroupBandwidth) (res *ent.GroupBandwidth, err error)
- func CreateOnlineSession(data ent.OnlineSession) (res *ent.OnlineSession, err error)
- func CreateUser(data ent.Users) (res *ent.Users, err error)
- func DeleteGroup(id int) (err error)
- func DeleteGroupBandwidth(id int) (err error)
- func DeleteOnlineSession(id int) (err error)
- func DeleteUser(id int) (err error)
- func Logout(session *LoggedSession)
- func ReadAllAllGroupBandwidth() (res []*ent.GroupBandwidth, err error)
- func ReadAllGroup() (res []*ent.Groups, err error)
- func ReadAllOnlineSession() (res []*ent.OnlineSession, err error)
- func ReadAllUser() (res []*ent.Users, err error)
- func ReadGroup(id int) (res *ent.Groups, err error)
- func ReadGroupBandwidth(id int) (res *ent.GroupBandwidth, err error)
- func ReadGroupBandwidthWithPagination(page, p_page int) (res []*ent.GroupBandwidth, record_count int, err error)
- func ReadGroupWithPagination(page, p_page int) (res []*ent.Groups, record_count int, err error)
- func ReadGroupWithSearch(search string, page, p_page int) (res []*ent.Groups, record_count int, err error)
- func ReadOnlineSession(id int) (res *ent.OnlineSession, err error)
- func ReadUser(id int) (res *ent.Users, err error)
- func ReadUserWithPagination(page, p_page int) (res []*ent.Users, record_count int, err error)
- func ReadUserWithSearch(search string, page, p_page int) (res []*ent.Users, record_count int, err error)
- func ResetPassword(pid string) (err error)
- func UpdateGroup(data ent.Groups) (res *ent.Groups, err error)
- func UpdateGroupBandwidth(data ent.GroupBandwidth) (res *ent.GroupBandwidth, err error)
- func UpdateUser(data ent.Users) (res *ent.Users, err error)
- func UpsertUser(data ent.Users) (err error)
- type AuthResponse
- type AuthSchema
- type LoggedSession
- type MultiCreateErrorMsg
- type MultiCreateSchema
Constants ¶
This section is empty.
Variables ¶
View Source
var ( DB_CLIENT *ent.Client LDAP_CLIENT *ldap.Conn BASE_DN string DOMAIN_NAME string EMAIL_DOMAIN_NAME string NEVER_EXPIRE int = 9223372036854775807 )
View Source
var LoggedSessionVar = make(map[string]*LoggedSession)
Functions ¶
func APIAuthentication ¶
func ChangePassword ¶
func CheckTimeout ¶
func CheckTimeout(session *LoggedSession)
func CountAllGroup ¶
func CountAllOnlineSession ¶
func CountAllUser ¶
func CreateGroupBandwidth ¶
func CreateGroupBandwidth(data ent.GroupBandwidth) (res *ent.GroupBandwidth, err error)
func CreateOnlineSession ¶
func CreateOnlineSession(data ent.OnlineSession) (res *ent.OnlineSession, err error)
func DeleteGroup ¶
func DeleteGroupBandwidth ¶
func DeleteOnlineSession ¶
func DeleteUser ¶
func Logout ¶
func Logout(session *LoggedSession)
func ReadAllAllGroupBandwidth ¶
func ReadAllAllGroupBandwidth() (res []*ent.GroupBandwidth, err error)
func ReadAllGroup ¶
func ReadAllOnlineSession ¶
func ReadAllOnlineSession() (res []*ent.OnlineSession, err error)
func ReadAllUser ¶
func ReadGroupBandwidth ¶
func ReadGroupBandwidth(id int) (res *ent.GroupBandwidth, err error)
func ReadGroupBandwidthWithPagination ¶
func ReadGroupBandwidthWithPagination(page, p_page int) (res []*ent.GroupBandwidth, record_count int, err error)
func ReadGroupWithPagination ¶
func ReadGroupWithSearch ¶
func ReadOnlineSession ¶
func ReadOnlineSession(id int) (res *ent.OnlineSession, err error)
func ReadUserWithPagination ¶
func ReadUserWithSearch ¶
func ResetPassword ¶
func UpdateGroupBandwidth ¶
func UpdateGroupBandwidth(data ent.GroupBandwidth) (res *ent.GroupBandwidth, err error)
func UpsertUser ¶
Types ¶
type AuthResponse ¶
type AuthResponse struct { Status string `json:"status"` Role string `json:"role"` Message string `json:"message"` }
func GetAuthentication ¶
func GetAuthentication(username, password string, only_super_admin bool) (res AuthResponse)
type AuthSchema ¶
type LoggedSession ¶
type LoggedSession struct { Username string `json:"username"` APISecret string `json:"api_secret"` Authorized bool `json:"authorized"` AtDatetime time.Time `json:"at_datetime"` Reason string `json:"reason"` }
func CheckSessionWithUsernameAndAPISecret ¶
func CheckSessionWithUsernameAndAPISecret(obj AuthSchema) (auth *LoggedSession, e error)
func FindLoggedSession ¶
func FindLoggedSession(username string) (session *LoggedSession, err error)
func GetAdminAuthentication ¶
func GetAdminAuthentication(obj AuthSchema) (auth *LoggedSession, err error)
type MultiCreateErrorMsg ¶
type MultiCreateErrorMsg struct { PersonalID string `json:"personal_id"` Error string `json:"error"` }
func MultiCreateUser ¶
func MultiCreateUser(data []MultiCreateSchema) (errmsg []MultiCreateErrorMsg)
type MultiCreateSchema ¶
Click to show internal directories.
Click to hide internal directories.