config

package
v0.0.0-...-82c350c Latest Latest
Warning

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

Go to latest
Published: May 27, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CONFIG_TYPE_SERVER = "server"
	CONFIG_TYPE_CLIENT = "client"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ClientConfig

type ClientConfig struct {
	Uuid          string `json:"uuid"`
	Operator      string `json:"operator"`
	Server        server `json:"server"`
	CaCertificate string `json:"caCertificate"`
	Certificate   string `json:"certificate"`
	PrivateKey    string `json:"privateKey"`
}

func NewClientConfig

func NewClientConfig(
	operatorName string,
	host string,
	port uint16,
	domains []string,
	caCert string,
	cert string,
	privateKey string,
) *ClientConfig

func ReadClientConfigJson

func ReadClientConfigJson(configPath string, isClient bool) (*ClientConfig, error)

func (*ClientConfig) WriteJson

func (c *ClientConfig) WriteJson() error

type ServerConfig

type ServerConfig struct {
	Host     string   `json:"host"`
	Port     uint16   `json:"port"`
	Domains  []string `json:"domains"`
	Listener listener `json:"listeners"`
}

func ReadServerConfigJson

func ReadServerConfigJson(configPath string, isClient bool) (*ServerConfig, error)

Jump to

Keyboard shortcuts

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