Documentation
¶
Index ¶
- func Add2FaSession(secret string, owner string)
- func AddRefreshToken(tkn *models.RefreshTokenModel)
- func AddTableEntry(displayname string, Tablename string, row map[string]interface{}) bool
- func AddUser(username string, hash string, root bool, mail string, status string)
- func ChangeNumOfEntrysBy(tablename string, indicator int)
- func CheckColumnNames(columns []models.RowConfigModel) bool
- func CheckIfTableExists(name string) bool
- func CheckUserHasHigherPermission(conn *sql.DB, username string, permLevel int, permName string) bool
- func CheckUserOwnsRefreshToken(user string, token string) bool
- func CreateTable(displayname string, Tablename string, RowConfig []models.RowConfigModel, ...) bool
- func DeleteTableEntry(entryID int, tablename string) bool
- func DeleteUser(username string)
- func DropTable(tablename string)
- func GetAll2FaSessions() []models.TwoFactorModel
- func GetAll2FaSessionsOfUser(owner string) []models.TwoFactorModel
- func GetAllPermissions() []models.PermissionModel
- func GetAllPermissionsWithHigherPermLvl(minPermLvl int) []models.PermissionModel
- func GetAllTables(username string) []models.TableModel
- func GetAllUser() []models.UserModel
- func GetConn() (conn *sql.DB)
- func GetHighestPermission(conn *sql.DB, username string) int
- func GetPermissionByName(name string) (bool, models.PermissionModel)
- func GetPermissionsOfUser(username string) []models.PermissionModel
- func GetRefreshToken(token string) (bool, models.RefreshTokenModel)
- func GetTableByName(name string) models.TableModel
- func GetUserByUsername(username string) (bool, models.UserModel)
- func GetUsersByPermission(permission string) []models.UserModel
- func InsertPermissionGroup(name string, color string, permLevel int)
- func MysqlLogin(username string, password string) (bool, string)
- func ParseToArray(input map[string]interface{}, columns []string) []interface{}
- func RenameTable(oldname string, newname string) bool
- func RenameTableColumn(tablename string, oldname string, newname string, datatype string, ...) bool
- func RevokeSession(user string, token string)
- func UpdateTableMinPermLvl(tablename string, newLvl int)
- func UpdateTablename(old string, new string)
- func UpdateUser2FA(username string, status bool)
- func UpdateUserPermission(username string, permissions string)
- func UpdateUserRoor(root bool, username string)
- type Column
- type Entries
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Add2FaSession ¶
func AddRefreshToken ¶
func AddRefreshToken(tkn *models.RefreshTokenModel)
func AddTableEntry ¶
/////////////////////////////////// Adds entry to given table // returns status of action // ///////////////////////////////////
func ChangeNumOfEntrysBy ¶
//////////////////////////////////// Changes number of table entrys // by indicator // ////////////////////////////////////
func CheckColumnNames ¶
func CheckColumnNames(columns []models.RowConfigModel) bool
///////////////////////////////////// checks if column names are valid // /////////////////////////////////////
func CheckIfTableExists ¶
//////////////////////////////////////// Checks if table exists // ////////////////////////////////////////
func CheckUserHasHigherPermission ¶
func CheckUserHasHigherPermission(conn *sql.DB, username string, permLevel int, permName string) bool
///////////////////////////////////////////// Checks if user has higher permission // than other user // /////////////////////////////////////////////
func CreateTable ¶
func CreateTable(displayname string, Tablename string, RowConfig []models.RowConfigModel, MinPermLvl int) bool
////////////////////////////////// Creates a table // //////////////////////////////////
func DeleteTableEntry ¶
/////////////////////////////// Deletes an table entry // of given table // ///////////////////////////////
func DeleteUser ¶
func DeleteUser(username string)
//////////////////////////////////////// Deletes an user from the database // ////////////////////////////////////////
func DropTable ¶
func DropTable(tablename string)
//////////////////////////////////////////// Deletes an database table completely // ////////////////////////////////////////////
func GetAll2FaSessions ¶
func GetAll2FaSessions() []models.TwoFactorModel
func GetAll2FaSessionsOfUser ¶
func GetAll2FaSessionsOfUser(owner string) []models.TwoFactorModel
func GetAllPermissions ¶
func GetAllPermissions() []models.PermissionModel
////////////////////////////////////// Queries all permission group // //////////////////////////////////////
func GetAllPermissionsWithHigherPermLvl ¶
func GetAllPermissionsWithHigherPermLvl(minPermLvl int) []models.PermissionModel
/////////////////////////////////////////////// Queries all permission groups with higher // permission level than the given // ///////////////////////////////////////////////
func GetAllTables ¶
func GetAllTables(username string) []models.TableModel
////////////////////////////////// Queries all tables // //////////////////////////////////
func GetAllUser ¶
//////////////////////////// Queries all user // ////////////////////////////
func GetConn ¶
/////////////////////////////////// opens connection to database // ///////////////////////////////////
func GetHighestPermission ¶
///////////////////////////////////////// returns highest permission of // given user // /////////////////////////////////////////
func GetPermissionByName ¶
func GetPermissionByName(name string) (bool, models.PermissionModel)
////////////////////////////////////////// Queries permission with specific name // //////////////////////////////////////////
func GetPermissionsOfUser ¶
func GetPermissionsOfUser(username string) []models.PermissionModel
////////////////////////////////////// Queries all permissions of user // //////////////////////////////////////
func GetRefreshToken ¶
func GetRefreshToken(token string) (bool, models.RefreshTokenModel)
func GetTableByName ¶
func GetTableByName(name string) models.TableModel
/////////////////////////////////////// Queries table with specific name // ///////////////////////////////////////
func GetUserByUsername ¶
/////////////////////////////// Queries user by username // ///////////////////////////////
func GetUsersByPermission ¶
//////////////////////////////// Queries all user with // specific permission // ////////////////////////////////
func InsertPermissionGroup ¶
////////////////////////////// Creates permission group // //////////////////////////////
func MysqlLogin ¶
////////////////////////////////////// Checks login status of user // by username and password // //////////////////////////////////////
func ParseToArray ¶
parse map to value array needs static map and column names
func RenameTable ¶
////////////////////////////////// Renames the given table // //////////////////////////////////
func RenameTableColumn ¶
func RenameTableColumn(tablename string, oldname string, newname string, datatype string, length string) bool
////////////////////////////////// Renames a column of table // //////////////////////////////////
func RevokeSession ¶
func UpdateTableMinPermLvl ¶
////////////////////////////////// Updates perm level of table // //////////////////////////////////
func UpdateTablename ¶
///////////////////////////////// Updates tablename in internal // inv_tables table // /////////////////////////////////
func UpdateUser2FA ¶
func UpdateUserPermission ¶
////////////////////////////////// Updates permission of user // //////////////////////////////////
func UpdateUserRoor ¶
Types ¶
type Column ¶
type Column struct {
COLUMN_NAME string `json:"COLUMN_NAME"`
DATA_TYPE string `json:"DATA_TYPE"`
MAX_LENGTH interface{} `json:"CHARACTER_MAXIMUM_LENGTH"`
}
global struct
func GetTableColumns ¶
/////////////////////////////////////////// Queries all columns of specific table // ///////////////////////////////////////////
func SelectColumnScheme ¶
/////////////////////////////////// Queries column scheme of table // ///////////////////////////////////
Source Files
¶
- Add2FaSession.go
- AddRefreshToken.go
- AddTableEntry.go
- AddUser.go
- ChangeNumOfEntrysBy.go
- CheckHigherPermission.go
- CheckIfTableExists.go
- CheckUserOwnsRefreshToken.go
- CreateTable.go
- DeleteTableEntry.go
- DeleteUser.go
- DropTable.go
- GetAll2FaSessions.go
- GetAll2FaSessionsOfUser.go
- GetAllPermissions.go
- GetAllPermissionsWithHigherPermLvl.go
- GetAllTables.go
- GetAllUser.go
- GetPermissionByName.go
- GetPermissionsOfUser.go
- GetRefreshToken.go
- GetTableByName.go
- GetTableColumns.go
- GetUserByUsername.go
- GetUsersByPermission.go
- InsertPermissionGroup.go
- Login.go
- RenameTable.go
- RenameTableColumn.go
- RevokeSession.go
- SelectColunmScheme.go
- UpdateTableMinPermLvl.go
- UpdateTableName.go
- UpdateUser2FA.go
- UpdateUserPermission.go
- UpdateUserRoot.go
- utils.go