dao

package
v0.0.47 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2024 License: GPL-3.0 Imports: 20 Imported by: 8

Documentation

Index

Constants

View Source
const (
	MSetBatchSize = 100
)

Variables

This section is empty.

Functions

func AdminCountUsers

func AdminCountUsers() (int64, error)

func AdminGetAllProxies added in v0.0.31

func AdminGetAllProxies(tx *gorm.DB) ([]*models.ProxyEntity, error)

func AdminGetAllUsers

func AdminGetAllUsers() ([]*models.UserEntity, error)

func AdminGetClientByClientID

func AdminGetClientByClientID(clientID string) (*models.ClientEntity, error)

func AdminGetServerByServerID

func AdminGetServerByServerID(serverID string) (*models.ServerEntity, error)

func AdminGetTenantProxies added in v0.0.31

func AdminGetTenantProxies(tenantID int) ([]*models.ProxyEntity, error)

func AdminMSaveTodyStats added in v0.0.31

func AdminMSaveTodyStats(tx *gorm.DB, s []*models.HistoryProxyStats) error

func AdminSaveTodyStats added in v0.0.31

func AdminSaveTodyStats(s *models.HistoryProxyStats) error

func AdminUpdateProxy added in v0.0.31

func AdminUpdateProxy(srv *models.ServerEntity, inputs []*pb.ProxyInfo) error

func CheckUserNameAndEmail

func CheckUserNameAndEmail(userName, email string) error

func CheckUserPassword

func CheckUserPassword(userNameOrEmail, password string) (bool, models.UserInfo, error)

func CountCerts

func CountCerts() (int64, error)

func CountClients

func CountClients(userInfo models.UserInfo) (int64, error)

func CountClientsWithKeyword added in v0.0.24

func CountClientsWithKeyword(userInfo models.UserInfo, keyword string) (int64, error)

func CountConfiguredClients

func CountConfiguredClients(userInfo models.UserInfo) (int64, error)

func CountConfiguredServers

func CountConfiguredServers(userInfo models.UserInfo) (int64, error)

func CountServers

func CountServers(userInfo models.UserInfo) (int64, error)

func CountServersWithKeyword added in v0.0.24

func CountServersWithKeyword(userInfo models.UserInfo, keyword string) (int64, error)

func CreateClient

func CreateClient(userInfo models.UserInfo, client *models.ClientEntity) error

func CreateServer

func CreateServer(userInfo models.UserInfo, server *models.ServerEntity) error

func CreateUser

func CreateUser(user *models.UserEntity) error

func DeleteClient

func DeleteClient(userInfo models.UserInfo, clientID string) error

func DeleteServer

func DeleteServer(userInfo models.UserInfo, serverID string) error

func GenX509Info

func GenX509Info(template *x509.Certificate) (certPem []byte, keyPem []byte, err error)

func GetAllClients

func GetAllClients(userInfo models.UserInfo) ([]*models.ClientEntity, error)

func GetClientByClientID

func GetClientByClientID(userInfo models.UserInfo, clientID string) (*models.ClientEntity, error)

func GetDefaultKeyPair

func GetDefaultKeyPair() (keyPem []byte, certPem []byte, err error)

func GetDefaultServer

func GetDefaultServer() (*models.ServerEntity, error)

func GetHistoryStatsByClientID added in v0.0.31

func GetHistoryStatsByClientID(userInfo models.UserInfo, clientID string) ([]*models.HistoryProxyStats, error)

func GetHistoryStatsByProxyID added in v0.0.31

func GetHistoryStatsByProxyID(userInfo models.UserInfo, proxyID int) ([]*models.HistoryProxyStats, error)

func GetHistoryStatsByServerID added in v0.0.31

func GetHistoryStatsByServerID(userInfo models.UserInfo, serverID string) ([]*models.HistoryProxyStats, error)

func GetProxyByClientID added in v0.0.31

func GetProxyByClientID(userInfo models.UserInfo, clientID string) ([]*models.ProxyEntity, error)

func GetProxyByServerID added in v0.0.31

func GetProxyByServerID(userInfo models.UserInfo, serverID string) ([]*models.ProxyEntity, error)

func GetServerByServerID

func GetServerByServerID(userInfo models.UserInfo, serverID string) (*models.ServerEntity, error)

func GetUserByUserID

func GetUserByUserID(userID int) (*models.UserEntity, error)

func GetUserByUserName

func GetUserByUserName(userName string) (*models.UserEntity, error)

func InitDefaultServer

func InitDefaultServer(serverIP string)

func ListClients

func ListClients(userInfo models.UserInfo, page, pageSize int) ([]*models.ClientEntity, error)

func ListClientsWithKeyword added in v0.0.24

func ListClientsWithKeyword(userInfo models.UserInfo, page, pageSize int, keyword string) ([]*models.ClientEntity, error)

func ListServers

func ListServers(userInfo models.UserInfo, page, pageSize int) ([]*models.ServerEntity, error)

func ListServersWithKeyword added in v0.0.24

func ListServersWithKeyword(userInfo models.UserInfo, page, pageSize int, keyword string) ([]*models.ServerEntity, error)

func UpdateClient

func UpdateClient(userInfo models.UserInfo, client *models.ClientEntity) error

func UpdateDefaultServer

func UpdateDefaultServer(c *models.Server) error

func UpdateServer

func UpdateServer(userInfo models.UserInfo, server *models.ServerEntity) error

func UpdateUser

func UpdateUser(userInfo models.UserInfo, user *models.UserEntity) error

func ValidateClientSecret

func ValidateClientSecret(clientID, clientSecret string) (*models.ClientEntity, error)

func ValidateServerSecret

func ValidateServerSecret(serverID string, secret string) (*models.ServerEntity, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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