Documentation ¶
Index ¶
- Variables
- func ActivateAccount(id string) (*model.Account, error)
- func AuthFromContext(c *gin.Context, id string) (*model.Account, interface{}, error)
- func CreateAccount(account *model.Account) (*model.Account, error)
- func CreateDevice(device *model.Device) (*model.Device, error)
- func CreateNet(net *model.Network) (*model.Network, error)
- func CreateService(service *model.Service) (*model.Service, error)
- func CreateSubscription(service *model.Subscription) (*model.Subscription, error)
- func CreateUser(user *model.User) (*model.User, error)
- func CreateVPN(vpn *model.VPN) (*model.VPN, error)
- func DeleteAccount(id string) error
- func DeleteDevice(id string) error
- func DeleteNet(id string) error
- func DeleteService(id string) error
- func DeleteSubscription(id string) error
- func DeleteUser(id string) error
- func DeleteVPN(id string) error
- func Email(id string) error
- func EmailUser(id string, account string) error
- func EnforceLimits() bool
- func FlushCache(id string)
- func GetAccount(email string, accountid string) (*model.Account, error)
- func GetAccountFromApiKey(apikey string) (*model.Account, error)
- func GetAllReservedIps() ([]string, error)
- func GetAllReservedNetIps(netId string) ([]string, error)
- func GetCache(id string) (interface{}, bool)
- func GetDefaultMaxDevices() int
- func GetDefaultMaxMembers() int
- func GetDefaultMaxNetworks() int
- func GetDefaultMaxServices() int
- func GetDefaultTolerance() float64
- func ReadAccount(id string) (*model.Account, error)
- func ReadAllAccounts(email string) ([]*model.Account, error)
- func ReadDevice(id string) (*model.Device, error)
- func ReadDevice2(param string, id string) ([]*model.Device, error)
- func ReadDeviceByApiKey(apikey string) (*model.Device, error)
- func ReadDevices() ([]*model.Device, error)
- func ReadDevicesForAccount(accountid string) ([]*model.Device, error)
- func ReadDevicesForUser(email string) ([]*model.Device, error)
- func ReadLimits(accountid string) (*model.Limits, error)
- func ReadNet(id string) (*model.Network, error)
- func ReadNetworks(email string) ([]*model.Network, error)
- func ReadNetworksForAccount(accountId string) ([]*model.Network, error)
- func ReadServer() ([]*model.Server, error)
- func ReadServer2(id string) (*model.Server, error)
- func ReadService(id string) (*model.Service, error)
- func ReadServiceVPN(serviceGroup string) ([]*model.Service, error)
- func ReadServices(email string) ([]*model.Service, error)
- func ReadServicesForAccount(accountId string) ([]*model.Service, error)
- func ReadSubscription(id string) (*model.Subscription, error)
- func ReadSubscriptions(email string) ([]*model.Subscription, error)
- func ReadUser(id string) (*model.User, error)
- func ReadUsers() ([]*model.User, error)
- func ReadVPN(id string) (*model.VPN, error)
- func ReadVPN2(param string, id string) ([]*model.VPN, error)
- func ReadVPNConfig(id string) ([]byte, *string, error)
- func ReadVPNs() ([]*model.VPN, error)
- func ReadVPNsForUser(email string) ([]*model.VPN, error)
- func Sanitize(s string) string
- func SetCache(id string, status interface{})
- func UpdateAccount(Id string, user *model.Account) (*model.Account, error)
- func UpdateDevice(Id string, device *model.Device, fUpdated bool) (*model.Device, error)
- func UpdateNet(Id string, net *model.Network) (*model.Network, error)
- func UpdateServer(server *model.Server) (*model.Server, error)
- func UpdateService(Id string, service *model.Service) (*model.Service, error)
- func UpdateSubscription(Id string, subscription *model.Subscription) (*model.Subscription, error)
- func UpdateUser(Id string, user *model.User) (*model.User, error)
- func UpdateVPN(Id string, vpn *model.VPN, flag bool) (*model.VPN, error)
Constants ¶
This section is empty.
Variables ¶
var (
CreateLock sync.Mutex
)
var StatusCache *cache.Cache = cache.New((1 * time.Minute), (1 * time.Minute))
Functions ¶
func ActivateAccount ¶
ActivateAccount when joining
func AuthFromContext ¶
AuthFromContext takes the gin context, the id from the request and the account and object used to find the account, along with any error.
Example: account, device, err := GetFromContext(c, id)
func CreateAccount ¶
CreateAccount with all necessary data
func CreateDevice ¶
CreateDevice device with all necessary data
func CreateService ¶
CreateService service with all necessary data
func CreateSubscription ¶
func CreateSubscription(service *model.Subscription) (*model.Subscription, error)
CreateSubscription all necessary data
func CreateUser ¶
CreateUser user with all necessary data
func EnforceLimits ¶
func EnforceLimits() bool
func FlushCache ¶
func FlushCache(id string)
func GetAllReservedIps ¶
GetAllReservedIps the list of all reserved IPs, client and server
func GetAllReservedNetIps ¶
GetAllReservedIps the list of all reserved IPs, client and server
func GetDefaultMaxDevices ¶
func GetDefaultMaxDevices() int
func GetDefaultMaxMembers ¶
func GetDefaultMaxMembers() int
func GetDefaultMaxNetworks ¶
func GetDefaultMaxNetworks() int
func GetDefaultMaxServices ¶
func GetDefaultMaxServices() int
func GetDefaultTolerance ¶
func GetDefaultTolerance() float64
func ReadAllAccounts ¶
ReadAllAccounts account by id or email address
func ReadDevice2 ¶
ReadDevice2 device by param and id
func ReadDeviceByApiKey ¶
ReadDeviceByApiKey(device.ApiKey)
func ReadDevicesForAccount ¶
ReadDevicesForAccount
func ReadDevicesForUser ¶
ReadDevices all devices This code needs a severe rewrite
func ReadNetworks ¶
ReadNetworks all clients
func ReadNetworksForAccount ¶
func ReadServiceVPN ¶
ReadServiceVPN returns all services configured for a vpn
func ReadServices ¶
ReadServices all clients
func ReadServicesForAccount ¶
func ReadSubscription ¶
func ReadSubscription(id string) (*model.Subscription, error)
ReadSubscription by id
func ReadSubscriptions ¶
func ReadSubscriptions(email string) ([]*model.Subscription, error)
ReadSubscriptions all clients
func ReadVPNConfig ¶
ReadVPNConfig in wg format
func UpdateAccount ¶
UpdateUser preserve keys
func UpdateDevice ¶
UpdateDevice preserve keys
func UpdateServer ¶
UpdateServer keep private values from existing one
func UpdateService ¶
UpdateService preserve keys
func UpdateSubscription ¶
func UpdateSubscription(Id string, subscription *model.Subscription) (*model.Subscription, error)
UpdateSubscription by id
func UpdateUser ¶
UpdateUser preserve keys
Types ¶
This section is empty.