Versions in this module Expand all Collapse all v0 v0.0.8 Sep 15, 2024 v0.0.7 Sep 9, 2024 v0.0.6 Aug 24, 2024 Changes in this version + func AllocateRole2User(userID uint64, roles_id []int) (enconterError error) + func AppendAuditLog(auditLog map[string]interface{}) + func CreateRole(query *query2.RoleEditQuery, routers []Router) (enconterError error) + func DeleteRoleWithID(id uint64) error + func DeleteUserWithID(id uint64) error + func GetAuditLogs(offset, limit int, sort string) (map[string]interface{}, error) + func GetRoles(offset, limit int, sort string) (map[string]interface{}, error) + func GetRouters(offset, limit int, sort string) (map[string]interface{}, error) + func GetUsers(offset, limit int, sort string) (map[string]interface{}, error) + func UpdateRoleWithID(query *query2.RoleEditQuery) (enconterError error) + func UpdateUserWithID(query *query.UserEditQuery) (enconterError error) + type Audit struct + Browser string + IP uint32 + Method string + Path string + System string + UserID uint64 + func (*Audit) TableName() string + type AuditList struct + Browser string + IP uint32 + Method string + Path string + System string + Username string + func (*AuditList) TableName() string + type Role struct + Description string + Name string + Routers []Router + Tokens []Token + Users []User + func GenerateRoleWithID(ids []int) []Role + func (*Role) TableName() string + type RoleInfo struct + ID int + Name string + func (*RoleInfo) TableName() string + type RoleList struct + Description string + ID int + Name string + func (*RoleList) TableName() string + type Router struct + Method string + Path string + Roles []Role + func GenerateRouterWithID(ids []int) []Router + func (*Router) TableName() string + type RouterList struct + CreatedAt time.Time + ID int + Method string + Path string + func GetRoutersWithRID(roleIDs []string) (routers []*RouterList, encounterError error) + func (*RouterList) TableName() string type Token + Roles []Role type User + Roles []Role + func (*User) TableName() string + type UserInfo struct + ID uint + Roles []RoleInfo + Username string + func GetRolesWithUID(uid int) (user *UserInfo, encounterError error) + func (*UserInfo) TableName() string + type UserList struct + CreatedAt time.Time + DeletedAt gorm.DeletedAt + ID uint + LoginIP int + Roles []Role + UpdatedAt time.Time + Username string + func (*UserList) TableName() string + type UserRoles struct + ID int + Name string + func (*UserRoles) TableName() string v0.0.5 May 17, 2023 Changes in this version + func HostCounter() int64 + func TagCounter() int64 + func TemplateCounter() int64 + type Classify struct + Count int + Name string + func HostClassify() ([]*Classify, error) + func (*Classify) TableName() string v0.0.4 May 4, 2023 Changes in this version + func TokenIsDestoryed(tokenStr string) bool v0.0.3 May 2, 2023 Changes in this version + const Secret + var DB *gorm.DB + func CheckPortIsExistWithName(name string) bool + func CheckTagIsExistWithName(name string) bool + func CheckTemplateIsExistWithName(name string) bool + func CreateHost(hostIP, host string, tagID int) (enconterError error) + func CreateHostWithHost(host *Host) (enconterError error) + func CreatePort(port uint16, protocol string, template_id int) (enconterError error) + func CreateRich(query *queryapi.RichEditQuery) (enconterError error) + func CreateTag(tagQuery *apis.TagEditQuery) (enconterError error) + func CreateTemplate(name, description, target string) (enconterError error) + func CreateToken(SignedTo, description string) (enconterError error) + func CreateUser(userQuery *apis.UserQuery) (enconterError error) + func DeleteHostWithID(id uint64) error + func DeletePortWithID(id uint64) error + func DeleteRichWithID(id uint64) error + func DeleteTagWithID(id uint64) error + func DeleteTemplateWithID(id uint64) error + func DeleteTokenWithID(id uint64) error + func EncryptPassword(p string) string + func GetHosts(offset, limit int, sort string) (map[string]interface{}, error) + func GetPorts(offset, limit int, sort string) (map[string]interface{}, error) + func GetRequestIP(r *http.Request) (uint32, error) + func GetRich(offset, limit int, sort string) (map[string]interface{}, error) + func GetSimpleTemplates(offset, limit int, sort string) (map[string]interface{}, error) + func GetTags(offset, limit int, sort string) (map[string]interface{}, error) + func GetTemplates(offset, limit int, sort string) (map[string]interface{}, error) + func GetTokens(offset, limit int, sort string) (map[string]interface{}, error) + func InitDB(driver string) error + func LastLogin(uid int64, ip uint32) bool + func Migration(driver string) error + func MySQL() (*gorm.DB, error) + func SQLite() (*gorm.DB, error) + func UpdateHostWithID(query *apis.HostQuery) (enconterError error) + func UpdatePortWithID(id uint64, port uint16, protocol string, template_id int) (enconterError error) + func UpdateRichWithID(query *queryapi.RichEditQuery) (enconterError error) + func UpdateTagWithID(query *apis.TagEditQuery) (enconterError error) + func UpdateTemplateWithID(id uint64, name, description, target string) (enconterError error) + func UpdateTokenWithID(id uint64, signedTo, description string, isUpdate bool) (enconterError error) + type Host struct + Hostname string + IP uint32 + TagId int + func QueryHostWithID(uid int) (*Host, error) + func QueryHostWithName(hostname string) (*Host, error) + type HostList struct + Hostname string + ID int + Ip uint32 + Tag string + TagId int + func (*HostList) TableName() string + type Port struct + Port uint16 + Protocol string + TemplateId int + type PortList struct + ID int + Port uint16 + Protocol string + Template string + TemplateID int + func (*PortList) TableName() string + type Rich struct + Action string + Destination *apis.Destination + Family string + Limit uint16 + LimitUnit string + Port []*apis.Port + Protocol *apis.Protocol + Source *apis.Source + TemplateID int + func (r *Rich) Scan(value interface{}) error + func (r *Rich) Value() (value driver.Value, err error) + type RichList struct + Action string + Destination *apis.Destination + Family string + ID int + Limit uint16 + LimitUnit string + Port []*apis.Port + Protocol *apis.Protocol + Source *apis.Source + Template string + TemplateID int + func (*RichList) TableName() string + func (r *RichList) Scan(value interface{}) error + func (r *RichList) Value() (value driver.Value, err error) + type Tag struct + Description string + Hosts []Host + Name string + func CheckTagIsExistWithID(id int64) (Tag, error) + func (*Tag) TableName() string + type TagInfo struct + Description string + ID int + Name string + func (*TagInfo) TableName() string + type Template struct + Description string + Name string + Target string + type TemplateList struct + Description string + ID int + Name string + Target string + func (*TemplateList) TableName() string + type Token struct + Description string + SignedBy string + SignedTo string + Token string + type TokenList struct + Description string + ID int + SignedBy string + SignedTo string + Token string + func (*TokenList) TableName() string + type User struct + LoginIP int + Password string + Username string + func QueryUserWithUID(uid int64) (User, error) + func QueryUserWithUsername(username string) (User, error)