core

package
v0.0.0-...-eae6339 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2022 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	CreateLock sync.Mutex
)

Functions

func ActivateAccount

func ActivateAccount(id string) (string, error)

ActivateAccount when joining

func CreateAccount

func CreateAccount(account *model.Account) (*model.Account, error)

CreateAccount with all necessary data

func CreateHost

func CreateHost(host *model.Host) (*model.Host, error)

CreateHost host with all necessary data

func CreateMesh

func CreateMesh(mesh *model.Mesh) (*model.Mesh, error)

CreateMesh mesh with all necessary data

func CreateService

func CreateService(service *model.Service) (*model.Service, error)

CreateService service with all necessary data

func CreateSubscription

func CreateSubscription(service *model.Subscription) (*model.Subscription, error)

CreateSubscription all necessary data

func CreateUser

func CreateUser(user *model.User) (*model.User, error)

CreateUser user with all necessary data

func DeleteAccount

func DeleteAccount(id string) error

DeleteAccount from mongo

func DeleteHost

func DeleteHost(id string) error

DeleteHost from database

func DeleteMesh

func DeleteMesh(id string) error

DeleteMesh from disk

func DeleteService

func DeleteService(id string) error

DeleteService from database

func DeleteSubscription

func DeleteSubscription(id string) error

DeleteSubscription by id

func DeleteUser

func DeleteUser(id string) error

DeleteUser from database

func EmailHost

func EmailHost(id string) error

EmailHost send email to host

func EmailUser

func EmailUser(id string, account string, mesh string) error

EmailHost send email to host

func GetAllReservedIps

func GetAllReservedIps() ([]string, error)

GetAllReservedIps the list of all reserved IPs, client and server

func GetAllReservedMeshIps

func GetAllReservedMeshIps(meshId string) ([]string, error)

GetAllReservedIps the list of all reserved IPs, client and server

func ReadAccount

func ReadAccount(id string) (*model.Account, error)

ReadACcount by id

func ReadAllAccounts

func ReadAllAccounts(email string) ([]*model.Account, error)

ReadAllAccounts account by id or email address

func ReadHost

func ReadHost(id string) (*model.Host, error)

ReadHost host by id

func ReadHost2

func ReadHost2(param string, id string) ([]*model.Host, error)

ReadHost2 host by param and id

func ReadHostConfig

func ReadHostConfig(id string) ([]byte, *string, error)

ReadHostConfig in wg format

func ReadHosts

func ReadHosts() ([]*model.Host, error)

ReadHosts all hosts

func ReadHostsForUser

func ReadHostsForUser(email string) ([]*model.Host, error)

ReadHosts all hosts

func ReadMesh

func ReadMesh(id string) (*model.Mesh, error)

ReadMesh mesh by id

func ReadMeshes

func ReadMeshes(email string) ([]*model.Mesh, error)

ReadMeshes all clients

func ReadServer

func ReadServer() ([]*model.Server, error)

ReadServer object, create default one

func ReadServer2

func ReadServer2(id string) (*model.Server, error)

ReadServer2

func ReadService

func ReadService(id string) (*model.Service, error)

ReadService service by id

func ReadServiceHost

func ReadServiceHost(serviceGroup string) ([]*model.Service, error)

ReadServiceHost returns all services configured for a host

func ReadServices

func ReadServices(email string) ([]*model.Service, error)

ReadServices all clients

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 ReadUser

func ReadUser(id string) (*model.User, error)

ReadUser user by id

func ReadUsers

func ReadUsers() ([]*model.User, error)

ReadUsers all users

func UpdateAccount

func UpdateAccount(Id string, user *model.Account) (*model.Account, error)

UpdateUser preserve keys

func UpdateHost

func UpdateHost(Id string, host *model.Host, flag bool) (*model.Host, error)

UpdateHost preserve keys

func UpdateMesh

func UpdateMesh(Id string, mesh *model.Mesh) (*model.Mesh, error)

UpdateMesh preserve keys

func UpdateServer

func UpdateServer(server *model.Server) (*model.Server, error)

UpdateServer keep private values from existing one

func UpdateService

func UpdateService(Id string, service *model.Service) (*model.Service, error)

UpdateService preserve keys

func UpdateSubscription

func UpdateSubscription(Id string, subscription *model.Subscription) (*model.Subscription, error)

UpdateSubscription by id

func UpdateUser

func UpdateUser(Id string, user *model.User) (*model.User, error)

UpdateUser preserve keys

Types

This section is empty.

Jump to

Keyboard shortcuts

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