storage

package
v0.0.0-...-11a1dea Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2025 License: GPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddAccount

func AddAccount(account models.Account) (int, error)

Refactored user functions to use PostgreSQL

func AddUnit

func AddUnit(uuid string, ipaddr string) error

func AddUnitGroup

func AddUnitGroup(group models.UnitGroup) (int, error)

AddUnitGroup adds a new unit group. Only admin can execute.

func DeleteAccount

func DeleteAccount(accountID string) error

func DeleteUnit

func DeleteUnit(uuid string) error

func DeleteUnitGroup

func DeleteUnitGroup(groupID int) error

func GetAccount

func GetAccount(accountID string) ([]models.Account, error)

func GetAccounts

func GetAccounts() ([]models.Account, error)

func GetFreeIP

func GetFreeIP() string

func GetPassword

func GetPassword(accountUsername string) string

func GetRecoveryCodes

func GetRecoveryCodes(username string) []string

func GetUnit

func GetUnit(uuid string) (map[string]interface{}, error)

func GetUnitCredentials

func GetUnitCredentials(uuid string) (string, string, error)

func GetUnitGroup

func GetUnitGroup(groupID int) (models.UnitGroup, error)

func GetUnitInfo

func GetUnitInfo(uuid string) map[string]interface{}

func GetUserOtpSecret

func GetUserOtpSecret(username string) string

func GetUserUnits

func GetUserUnits() map[string][]string

func Init

func Init() *pgxpool.Pool

func InitReportDb

func InitReportDb() (*pgxpool.Pool, context.Context)

func Is2FAEnabled

func Is2FAEnabled(username string) bool

func IsAdmin

func IsAdmin(accountUsername string) bool

func IsUnitGroupUsed

func IsUnitGroupUsed(groupID int) (bool, error)

func ListConnectedUnits

func ListConnectedUnits() ([]string, error)

func ListUnitGroups

func ListUnitGroups() ([]models.UnitGroup, error)

func ListUnits

func ListUnits() ([]map[string]interface{}, error)

func LoadAdminUsersList

func LoadAdminUsersList() ([]string, error)

func LoadUserUnitsMap

func LoadUserUnitsMap() (map[string][]string, error)

func ReloadACLs

func ReloadACLs()

func ReportInstance

func ReportInstance() (*pgxpool.Pool, context.Context)

func SetUnitAddress

func SetUnitAddress(uuid string, ipaddr string) error

func SetUnitCredentials

func SetUnitCredentials(uuid string, username string, password string) error

func SetUnitInfo

func SetUnitInfo(uuid string, info models.UnitInfo) error

func SetUserOtpSecret

func SetUserOtpSecret(username string, secret string) error

func SetUserRecoveryCodes

func SetUserRecoveryCodes(username string, codes []string) error

func UnitExists

func UnitExists(uuid string) (bool, error)

func UnitGroupExists

func UnitGroupExists(groupID int) (bool, error)

func UpdateAccount

func UpdateAccount(accountID string, account models.AccountUpdate) error

func UpdatePassword

func UpdatePassword(accountUsername string, newPassword string) error

func UpdateUnitGroup

func UpdateUnitGroup(groupId int, group models.UnitGroup) error

func UpdateUnitVpnStatus

func UpdateUnitVpnStatus(uuid string, connectedSince int) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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