core

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2022 License: GPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateClient

func CreateClient(client *model.Client) (*model.Client, error)

CreateClient client with all necessary data

func DeleteClient

func DeleteClient(id string) error

DeleteClient from disk

func EmailClient

func EmailClient(id string) error

EmailClient send email to client

func GetAllReservedIps

func GetAllReservedIps() ([]string, error)

GetAllReservedIps the list of all reserved IPs, client and server

func GetServerStatus

func GetServerStatus() (*model.Status, error)

Method to get the server status

func MakeErrorResponse

func MakeErrorResponse(status int64, err string, server *model.Server, client *model.Client, clients []*model.Client) *model.Response

error response message

func MakeSucessResponse

func MakeSucessResponse(status int64, message string, server *model.Server, client *model.Client, clients []*model.Client) *model.Response

success response message

func ReadClient

func ReadClient(id string) (*model.Client, error)

ReadClient client by id

func ReadClientConfig

func ReadClientConfig(id string) ([]byte, error)

ReadClientConfig in wg format

func ReadClients

func ReadClients() ([]*model.Client, error)

ReadClients all clients

func ReadServer

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

ReadServer object, create default one

func ReadWgConfigFile

func ReadWgConfigFile() ([]byte, error)

ReadWgConfigFile return content of wireguard config file

func UpdateClient

func UpdateClient(UUID string, client *model.Client) (*model.Client, error)

UpdateClient preserve keys

func UpdateServer

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

UpdateServer keep private values from existing one

func UpdateServerConfigWg

func UpdateServerConfigWg() error

UpdateServerConfigWg in wg format

Types

This section is empty.

Jump to

Keyboard shortcuts

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