Documentation
¶
Index ¶
- Constants
- func GenX509Info(template *x509.Certificate) (certPem []byte, keyPem []byte, err error)
- type CertMutation
- type CertQuery
- type ClientMutation
- type ClientQuery
- type EndpointMutation
- type EndpointQuery
- type LinkMutation
- type LinkQuery
- type Mutation
- type NetworkMutation
- type NetworkQuery
- type ProxyMutation
- type ProxyQuery
- type Query
- type ServerMutation
- type ServerQuery
- type StatsMutation
- type StatsQuery
- type UserGroupMutation
- type UserMutation
- type UserQuery
- type WireGuardMutation
- type WireGuardQuery
- type WorkerMutation
- type WorkerQuery
Constants ¶
View Source
const (
MSetBatchSize = 100
)
Variables ¶
This section is empty.
Functions ¶
func GenX509Info ¶
func GenX509Info(template *x509.Certificate) (certPem []byte, keyPem []byte, err error)
Types ¶
type CertMutation ¶ added in v0.1.25
type CertMutation interface {
InitCert(template *x509.Certificate) *tls.Config
}
type ClientMutation ¶ added in v0.1.25
type ClientQuery ¶ added in v0.1.25
type ClientQuery interface {
ValidateClientSecret(clientID, clientSecret string) (*models.ClientEntity, error)
AdminGetClientByClientID(clientID string) (*models.Client, error)
GetClientByClientID(userInfo models.UserInfo, clientID string) (*models.Client, error)
GetClientsByClientIDs(userInfo models.UserInfo, clientIDs []string) ([]*models.Client, error)
GetClientByFilter(userInfo models.UserInfo, client *models.ClientEntity, shadow *bool) (*models.ClientEntity, error)
GetClientByOriginClientID(originClientID string) (*models.ClientEntity, error)
ListClients(userInfo models.UserInfo, page, pageSize int) ([]*models.ClientEntity, error)
ListClientsWithKeyword(userInfo models.UserInfo, page, pageSize int, keyword string) ([]*models.ClientEntity, error)
GetAllClients(userInfo models.UserInfo) ([]*models.ClientEntity, error)
CountClients(userInfo models.UserInfo) (int64, error)
CountClientsWithKeyword(userInfo models.UserInfo, keyword string) (int64, error)
CountConfiguredClients(userInfo models.UserInfo) (int64, error)
CountClientsInShadow(userInfo models.UserInfo, clientID string) (int64, error)
GetClientIDsInShadowByClientID(userInfo models.UserInfo, clientID string) ([]string, error)
AdminGetClientIDsInShadowByClientID(clientID string) ([]string, error)
}
type EndpointMutation ¶ added in v0.1.25
type EndpointQuery ¶ added in v0.1.25
type EndpointQuery interface {
GetEndpointByID(userInfo models.UserInfo, id uint) (*models.Endpoint, error)
ListEndpoints(userInfo models.UserInfo, page, pageSize int) ([]*models.Endpoint, error)
CountEndpoints(userInfo models.UserInfo) (int64, error)
ListEndpointsWithFilters(userInfo models.UserInfo, page, pageSize int, clientID string, wireguardID uint, keyword string) ([]*models.Endpoint, error)
CountEndpointsWithFilters(userInfo models.UserInfo, clientID string, wireguardID uint, keyword string) (int64, error)
}
type LinkMutation ¶ added in v0.1.25
type LinkMutation interface {
CreateWireGuardLink(userInfo models.UserInfo, link *models.WireGuardLink) error
CreateWireGuardLinks(userInfo models.UserInfo, links ...*models.WireGuardLink) error
UpdateWireGuardLink(userInfo models.UserInfo, id uint, link *models.WireGuardLink) error
DeleteWireGuardLink(userInfo models.UserInfo, id uint) error
}
type LinkQuery ¶ added in v0.1.25
type LinkQuery interface {
ListWireGuardLinksByNetwork(userInfo models.UserInfo, networkID uint) ([]*models.WireGuardLink, error)
GetWireGuardLinkByID(userInfo models.UserInfo, id uint) (*models.WireGuardLink, error)
GetWireGuardLinkByClientIDs(userInfo models.UserInfo, fromClientId, toClientId uint) (*models.WireGuardLink, error)
ListWireGuardLinksWithFilters(userInfo models.UserInfo, page, pageSize int, networkID uint, keyword string) ([]*models.WireGuardLink, error)
CountWireGuardLinksWithFilters(userInfo models.UserInfo, networkID uint, keyword string) (int64, error)
AdminListWireGuardLinksWithNetworkIDs(networkIDs []uint) ([]*models.WireGuardLink, error)
}
type Mutation ¶ added in v0.1.25
type Mutation interface {
CertMutation
ClientMutation
EndpointMutation
LinkMutation
NetworkMutation
ProxyMutation
ServerMutation
StatsMutation
UserMutation
WireGuardMutation
WorkerMutation
UserGroupMutation
}
func NewMutation ¶ added in v0.1.25
type NetworkMutation ¶ added in v0.1.25
type NetworkQuery ¶ added in v0.1.25
type NetworkQuery interface {
GetNetworkByID(userInfo models.UserInfo, id uint) (*models.Network, error)
ListNetworks(userInfo models.UserInfo, page, pageSize int) ([]*models.Network, error)
ListNetworksWithKeyword(userInfo models.UserInfo, page, pageSize int, keyword string) ([]*models.Network, error)
CountNetworks(userInfo models.UserInfo) (int64, error)
CountNetworksWithKeyword(userInfo models.UserInfo, keyword string) (int64, error)
}
type ProxyMutation ¶ added in v0.1.25
type ProxyMutation interface {
AdminUpdateProxyStats(srv *models.ServerEntity, inputs []*pb.ProxyInfo) error
AdminCreateProxyConfig(proxyCfg *models.ProxyConfig) error
RebuildProxyConfigFromClient(userInfo models.UserInfo, client *models.Client) error
CreateProxyConfig(userInfo models.UserInfo, proxyCfg *models.ProxyConfigEntity) error
UpdateProxyConfig(userInfo models.UserInfo, proxyCfg *models.ProxyConfig) error
DeleteProxyConfig(userInfo models.UserInfo, clientID, name string) error
DeleteProxyConfigsByClientIDOrOriginClientID(userInfo models.UserInfo, clientID string) error
DeleteProxyConfigsByClientID(userInfo models.UserInfo, clientID string) error
}
type ProxyQuery ¶ added in v0.1.25
type ProxyQuery interface {
GetProxyStatsByClientID(userInfo models.UserInfo, clientID string) ([]*models.ProxyStatsEntity, error)
GetProxyStatsByServerID(userInfo models.UserInfo, serverID string) ([]*models.ProxyStatsEntity, error)
AdminGetTenantProxyStats(tenantID int) ([]*models.ProxyStatsEntity, error)
AdminGetAllProxyStats(tx *gorm.DB) ([]*models.ProxyStatsEntity, error)
AdminGetProxyConfigByClientIDAndName(clientID string, name string) (*models.ProxyConfig, error)
GetProxyConfigsByClientID(userInfo models.UserInfo, clientID string) ([]*models.ProxyConfigEntity, error)
GetProxyConfigByFilter(userInfo models.UserInfo, proxyConfig *models.ProxyConfigEntity) (*models.ProxyConfig, error)
ListProxyConfigsWithFilters(userInfo models.UserInfo, page, pageSize int, filters *models.ProxyConfigEntity) ([]*models.ProxyConfig, error)
AdminListProxyConfigsWithFilters(filters *models.ProxyConfigEntity) ([]*models.ProxyConfig, error)
ListProxyConfigsWithFiltersAndKeyword(userInfo models.UserInfo, page, pageSize int, filters *models.ProxyConfigEntity, keyword string) ([]*models.ProxyConfig, error)
ListProxyConfigsWithKeyword(userInfo models.UserInfo, page, pageSize int, keyword string) ([]*models.ProxyConfig, error)
ListProxyConfigs(userInfo models.UserInfo, page, pageSize int) ([]*models.ProxyConfig, error)
GetProxyConfigByOriginClientIDAndName(userInfo models.UserInfo, clientID string, name string) (*models.ProxyConfig, error)
CountProxyConfigs(userInfo models.UserInfo) (int64, error)
CountProxyConfigsWithFilters(userInfo models.UserInfo, filters *models.ProxyConfigEntity) (int64, error)
CountProxyConfigsWithFiltersAndKeyword(userInfo models.UserInfo, filters *models.ProxyConfigEntity, keyword string) (int64, error)
GetProxyConfigsByWorkerId(userInfo models.UserInfo, workerID string) ([]*models.ProxyConfig, error)
}
type Query ¶
type Query interface {
CertQuery
ClientQuery
EndpointQuery
LinkQuery
NetworkQuery
ProxyQuery
ServerQuery
StatsQuery
UserQuery
WireGuardQuery
WorkerQuery
}
type ServerMutation ¶ added in v0.1.25
type ServerMutation interface {
InitDefaultServer(serverIP string)
UpdateDefaultServer(c *models.Server) error
CreateServer(userInfo models.UserInfo, server *models.ServerEntity) error
DeleteServer(userInfo models.UserInfo, serverID string) error
UpdateServer(userInfo models.UserInfo, server *models.ServerEntity) error
}
type ServerQuery ¶ added in v0.1.25
type ServerQuery interface {
GetDefaultServer() (*models.ServerEntity, error)
ValidateServerSecret(serverID string, secret string) (*models.ServerEntity, error)
AdminGetServerByServerID(serverID string) (*models.ServerEntity, error)
GetServerByServerID(userInfo models.UserInfo, serverID string) (*models.ServerEntity, error)
ListServers(userInfo models.UserInfo, page, pageSize int) ([]*models.ServerEntity, error)
ListServersWithKeyword(userInfo models.UserInfo, page, pageSize int, keyword string) ([]*models.ServerEntity, error)
CountServers(userInfo models.UserInfo) (int64, error)
CountServersWithKeyword(userInfo models.UserInfo, keyword string) (int64, error)
CountConfiguredServers(userInfo models.UserInfo) (int64, error)
}
type StatsMutation ¶ added in v0.1.25
type StatsMutation interface {
AdminSaveTodyStats(s *models.HistoryProxyStats) error
AdminMSaveTodyStats(tx *gorm.DB, s []*models.HistoryProxyStats) error
}
type StatsQuery ¶ added in v0.1.25
type StatsQuery interface {
GetHistoryStatsByProxyID(userInfo models.UserInfo, proxyID int) ([]*models.HistoryProxyStats, error)
GetHistoryStatsByClientID(userInfo models.UserInfo, clientID string) ([]*models.HistoryProxyStats, error)
GetHistoryStatsByServerID(userInfo models.UserInfo, serverID string) ([]*models.HistoryProxyStats, error)
}
type UserGroupMutation ¶ added in v0.1.25
type UserMutation ¶ added in v0.1.25
type UserMutation interface {
UpdateUser(userInfo models.UserInfo, user *models.UserEntity) error
AdminUpdateUser(userInfo models.UserInfo, user *models.UserEntity) error
CreateUser(user *models.UserEntity) error
}
type UserQuery ¶ added in v0.1.25
type UserQuery interface {
AdminGetAllUsers() ([]*models.UserEntity, error)
AdminCountUsers() (int64, error)
GetUserByUserID(userID int) (*models.UserEntity, error)
GetUserByUserName(userName string) (*models.UserEntity, error)
CheckUserPassword(userNameOrEmail, password string) (bool, models.UserInfo, error)
CheckUserNameAndEmail(userName, email string) error
}
type WireGuardMutation ¶ added in v0.1.25
type WireGuardQuery ¶ added in v0.1.25
type WireGuardQuery interface {
GetWireGuardByID(userInfo models.UserInfo, id uint) (*models.WireGuard, error)
AdminGetWireGuardByClientIDAndInterfaceName(clientID, interfaceName string) (*models.WireGuard, error)
GetWireGuardsByNetworkID(userInfo models.UserInfo, networkID uint) ([]*models.WireGuard, error)
GetWireGuardLocalAddressesByNetworkID(userInfo models.UserInfo, networkID uint) ([]string, error)
ListWireGuardsWithFilters(userInfo models.UserInfo, page, pageSize int, filter *models.WireGuardEntity, keyword string) ([]*models.WireGuard, error)
AdminListWireGuardsWithClientID(clientID string) ([]*models.WireGuard, error)
AdminListWireGuardsWithNetworkIDs(networkIDs []uint) ([]*models.WireGuard, error)
CountWireGuardsWithFilters(userInfo models.UserInfo, filter *models.WireGuardEntity, keyword string) (int64, error)
}
type WorkerMutation ¶ added in v0.1.25
type WorkerQuery ¶ added in v0.1.25
type WorkerQuery interface {
GetWorkerByWorkerID(userInfo models.UserInfo, workerID string) (*models.Worker, error)
ListWorkers(userInfo models.UserInfo, page, pageSize int) ([]*models.Worker, error)
AdminListWorkersByClientID(clientID string) ([]*models.Worker, error)
ListWorkersWithKeyword(userInfo models.UserInfo, page, pageSize int, keyword string) ([]*models.Worker, error)
CountWorkers(userInfo models.UserInfo) (int64, error)
CountWorkersWithKeyword(userInfo models.UserInfo, keyword string) (int64, error)
}
Click to show internal directories.
Click to hide internal directories.