services

package
v0.0.0-...-dba37e9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 5, 2021 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

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 APIAuthentication(c *gin.Context)

func ChangePassword

func ChangePassword(pid, old_password, password string) (err error)

func CheckTimeout

func CheckTimeout(session *LoggedSession)

func CountAllGroup

func CountAllGroup() (count int, err error)

func CountAllOnlineSession

func CountAllOnlineSession() (count int, err error)

func CountAllUser

func CountAllUser() (count int, err error)

func CreateGroup

func CreateGroup(data ent.Groups) (res *ent.Groups, err error)

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 CreateUser

func CreateUser(data ent.Users) (res *ent.Users, err error)

func DeleteGroup

func DeleteGroup(id int) (err error)

func DeleteGroupBandwidth

func DeleteGroupBandwidth(id int) (err error)

func DeleteOnlineSession

func DeleteOnlineSession(id int) (err error)

func DeleteUser

func DeleteUser(id int) (err error)

func Logout

func Logout(session *LoggedSession)

func ReadAllAllGroupBandwidth

func ReadAllAllGroupBandwidth() (res []*ent.GroupBandwidth, err error)

func ReadAllGroup

func ReadAllGroup() (res []*ent.Groups, err error)

func ReadAllOnlineSession

func ReadAllOnlineSession() (res []*ent.OnlineSession, err error)

func ReadAllUser

func ReadAllUser() (res []*ent.Users, err error)

func ReadGroup

func ReadGroup(id int) (res *ent.Groups, err error)

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 ReadGroupWithPagination(page, p_page int) (res []*ent.Groups, record_count int, err error)

func ReadGroupWithSearch

func ReadGroupWithSearch(search string, page, p_page int) (res []*ent.Groups, record_count int, err error)

func ReadOnlineSession

func ReadOnlineSession(id int) (res *ent.OnlineSession, err error)

func ReadUser

func ReadUser(id int) (res *ent.Users, err error)

func ReadUserWithPagination

func ReadUserWithPagination(page, p_page int) (res []*ent.Users, record_count int, err error)

func ReadUserWithSearch

func ReadUserWithSearch(search string, page, p_page int) (res []*ent.Users, record_count int, err error)

func ResetPassword

func ResetPassword(pid string) (err error)

func UpdateGroup

func UpdateGroup(data ent.Groups) (res *ent.Groups, err error)

func UpdateGroupBandwidth

func UpdateGroupBandwidth(data ent.GroupBandwidth) (res *ent.GroupBandwidth, err error)

func UpdateUser

func UpdateUser(data ent.Users) (res *ent.Users, err error)

func UpsertUser

func UpsertUser(data ent.Users) (err error)

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 AuthSchema struct {
	Username string `json:"username"`
	Password string `json:"password"`
}

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

type MultiCreateSchema struct {
	PersonalID    string `json:"personal_id"`
	OrgID         string `json:"org_id"`
	GroupName     string `json:"group_name"`
	FirstName     string `json:"first_name"`
	LastName      string `json:"last_name"`
	EnableAccount string `json:"enable_account"`
	Years         int    `json:"years"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL