Documentation
¶
Index ¶
- Constants
- Variables
- func GetDatabaseConfigPath() string
- func GetServerConfigPath() string
- type DNSJobConfig
- type DaemonConfig
- type DatabaseConfig
- type HTTPJobConfig
- type JobConfig
- type LogConfig
- type MTLSJobConfig
- type ServerConfig
- func (c *ServerConfig) AddDNSJob(config *DNSJobConfig) error
- func (c *ServerConfig) AddHTTPJob(config *HTTPJobConfig) error
- func (c *ServerConfig) AddMTLSJob(config *MTLSJobConfig) error
- func (c *ServerConfig) AddWGJob(config *WGJobConfig) error
- func (c *ServerConfig) RemoveJob(jobID string)
- func (c *ServerConfig) Save() error
- type WGJobConfig
Constants ¶
View Source
const ( // Sqlite - SQLite protocol Sqlite = "sqlite3" // Postgres - Postgresql protocol Postgres = "postgresql" // MySQL - MySQL protocol MySQL = "mysql" )
Variables ¶
View Source
var ( // ErrInvalidDialect - ErrInvalidDialect = errors.New("Invalid SQL Dialect") )
Functions ¶
func GetDatabaseConfigPath ¶
func GetDatabaseConfigPath() string
GetDatabaseConfigPath - File path to config.json
func GetServerConfigPath ¶
func GetServerConfigPath() string
GetServerConfigPath - File path to config.json
Types ¶
type DNSJobConfig ¶
type DaemonConfig ¶
DaemonConfig - Configure daemon mode
type DatabaseConfig ¶
type DatabaseConfig struct { Dialect string `json:"dialect"` Database string `json:"database"` Username string `json:"username"` Password string `json:"password"` Host string `json:"host"` Port uint16 `json:"port"` Params map[string]string `json:"params"` MaxIdleConns int `json:"max_idle_conns"` MaxOpenConns int `json:"max_open_conns"` LogLevel string `json:"log_level"` }
DatabaseConfig - Server config
func GetDatabaseConfig ¶
func GetDatabaseConfig() *DatabaseConfig
GetDatabaseConfig - Get config value
func (*DatabaseConfig) DSN ¶
func (c *DatabaseConfig) DSN() (string, error)
DSN - Get the db connections string https://github.com/go-sql-driver/mysql#examples
type HTTPJobConfig ¶
type JobConfig ¶
type JobConfig struct { MTLS []*MTLSJobConfig `json:"mtls,omitempty"` WG []*WGJobConfig `json:"wg,omitempty"` DNS []*DNSJobConfig `json:"dns,omitempty"` HTTP []*HTTPJobConfig `json:"http,omitempty"` }
JobConfig - Restart Jobs on Load
type LogConfig ¶
type LogConfig struct { Level int `json:"level"` GRPCUnaryPayloads bool `json:"grpc_unary_payloads"` GRPCStreamPayloads bool `json:"grpc_stream_payloads"` }
LogConfig - Server logging config
type MTLSJobConfig ¶
type MTLSJobConfig struct { Host string `json:"host"` Port uint16 `json:"port"` JobID string `json:"jobid"` }
MTLSJobConfig - Per-type job configs
type ServerConfig ¶
type ServerConfig struct { DaemonMode bool `json:"daemon_mode"` DaemonConfig *DaemonConfig `json:"daemon"` Logs *LogConfig `json:"logs"` Jobs *JobConfig `json:"jobs,omitempty"` }
ServerConfig - Server config
func (*ServerConfig) AddDNSJob ¶
func (c *ServerConfig) AddDNSJob(config *DNSJobConfig) error
AddDNSJob - Add a persistent DNS job
func (*ServerConfig) AddHTTPJob ¶
func (c *ServerConfig) AddHTTPJob(config *HTTPJobConfig) error
AddHTTPJob - Add a persistent job
func (*ServerConfig) AddMTLSJob ¶
func (c *ServerConfig) AddMTLSJob(config *MTLSJobConfig) error
AddMTLSJob - Add Job Configs
func (*ServerConfig) AddWGJob ¶ added in v1.4.9
func (c *ServerConfig) AddWGJob(config *WGJobConfig) error
AddWGJob - Add Job Configs
func (*ServerConfig) RemoveJob ¶
func (c *ServerConfig) RemoveJob(jobID string)
RemoveJob - Remove Job by ID
Click to show internal directories.
Click to hide internal directories.