Documentation ¶
Index ¶
- Variables
- func DeleteClient(id string) error
- func GenerateEthereumWalletAddress(mnemonic string)
- func GeneratePeaqDID(length int) (string, string, error)
- func GenerateWalletAddressAptos(mnemonic string)
- func GenerateWalletAddressSolana(mnemonic string)
- func GenerateWalletAddressSui(mnemonic string)
- func GetAllReservedIps() ([]string, error)
- func GetIPInfo()
- func GetPort(max, min int) (int, error)
- func GetServerStatus() (*model.Status, error)
- func Init()
- func IsValidPeaqDID(did string) bool
- func LoadNodeDetails()
- func MakeErrorResponse(status int64, err string, server *model.Server, client *model.Client, ...) *model.Response
- func MakeSucessResponse(status int64, message string, server *model.Server, client *model.Client, ...) *model.Response
- func ReadClient(id string) (*model.Client, error)
- func ReadClientConfig(id string) ([]byte, error)
- func ReadClients() ([]*model.Client, error)
- func ReadServer() (*model.Server, error)
- func ReadWgConfigFile() ([]byte, error)
- func RegisterClient(client *model.Client) (*model.Client, error)
- func ScanPort(port int) (string, error)
- func UpdateClient(UUID string, client *model.Client) (*model.Client, error)
- func UpdateServer(server *model.Server) (*model.Server, error)
- func UpdateServerConfigWg() error
- func Writefile(path string, bytes []byte) (err error)
- type IPInfo
Constants ¶
This section is empty.
Variables ¶
var ( Version string CodeHash string )
These variables will be set at build time
var CaddyConfDir = os.Getenv("WG_CONF_DIR")
WG_CONF_DIR
var CaddyFile = os.Getenv("CADDY_INTERFACE_NAME")
var CaddyJSON = "caddy.json"
var AppConfDir = "./conf"
var ChainName string
var NodeConfig string
var NodeName string
var NodeType string
var WalletAddress string
Functions ¶
func GenerateEthereumWalletAddress ¶
func GenerateEthereumWalletAddress(mnemonic string)
GenerateEthereumWalletAddress generates an Ethereum wallet address from the given mnemonic
func GenerateWalletAddressAptos ¶
func GenerateWalletAddressAptos(mnemonic string)
GenerateWalletAddressAptos generates an Aptos wallet address from the given mnemonic
func GenerateWalletAddressSolana ¶
func GenerateWalletAddressSolana(mnemonic string)
GenerateWalletAddressSolana generates a Solana wallet address from the given mnemonic
func GenerateWalletAddressSui ¶
func GenerateWalletAddressSui(mnemonic string)
GenerateWalletAddressSui generates a Sui wallet address from the given mnemonic
func GetAllReservedIps ¶
GetAllReservedIps the list of all reserved IPs, client and server
func GetServerStatus ¶
Method to get the server status
func IsValidPeaqDID ¶
func LoadNodeDetails ¶
func LoadNodeDetails()
Function to load the node details from the environment and save it to the global variable
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 ReadClientConfig ¶
func ReadWgConfigFile ¶
ReadWgConfigFile return content of wireguard config file
func RegisterClient ¶
RegisterClient client with all necessary data
func UpdateClient ¶
UpdateClient preserve keys
func UpdateServer ¶
UpdateServer keep private values from existing one