Documentation ¶
Index ¶
Constants ¶
View Source
const ( DBTypeMySQL dbType = "mysql" DBTypePostgreSQL dbType = "postgresql" DBTypeSQLite3 dbType = "sqlite3" DBTypeSQLServer dbType = "sqlserver" )
View Source
const DEFAULT_ADMIN_USERNAME = "admin"
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ClientTOML ¶
type ClientTOML struct { Port int `mapstructure:"port" toml:"port" validate:"numeric,gte=0,lte=65535,required,nefield=HTTPPort"` HTTPPort int `mapstructure:"http_port" toml:"http_port" validate:"numeric,gte=0,lte=65535,required,nefield=RedirPort"` RedirPort int `mapstructure:"redir_port" toml:"redir_port" validate:"numeric,gte=0,lte=65535,required,nefield=Port"` Server string `mapstructure:"server" toml:"server" validate:"hostname,required"` Username string `mapstructure:"username" toml:"username" validate:"required"` Password string `mapstructure:"password" toml:"password" validate:"required"` ProxyAll bool `mapstructure:"proxy_all" toml:"proxy_all"` }
func (*ClientTOML) Init ¶
func (ct *ClientTOML) Init() (cg *ClientGo, err error)
type ConfigGo ¶
type ConfigGo struct { Log *LogGo //client,server DNS *DNSGo //client,server Client *ClientGo //client Server *serverGo //server DB *dbGo //server // contains filtered or unexported fields }
func NewConfClient ¶
func NewConfServer ¶
func (*ConfigGo) InitClient ¶
func (*ConfigGo) SaveClient ¶
type ConfigTOML ¶
type ConfigTOML struct { Log *LogTOML `mapstructure:"log" toml:"log" validate:"required"` DNS *DNSToml `mapstructure:"dns" toml:"dns" validate:"required"` Client *ClientTOML `mapstructure:"client" toml:"client" validate:"-"` Server *ServerTOML `mapstructure:"server" toml:"server" validate:"-"` DB *DBToml `mapstructure:"db" toml:"db" validate:"-"` }
ConfigTOML is the struct mapped from the configuration file
func (*ConfigTOML) Init ¶
func (mc *ConfigTOML) Init() (cg *ConfigGo, err error)
type DBToml ¶
type DBToml struct { Type string `mapstructure:"type" toml:"type" validate:"required"` Username string `mapstructure:"username" toml:"username" validate:"required"` Password string `mapstructure:"password" toml:"password" validate:"required"` Host string `mapstructure:"host" toml:"host" validate:"required"` Port int `mapstructure:"port" toml:"port" validate:"required"` Database string `mapstructure:"database" toml:"database" validate:"required"` }
type DNSToml ¶
type DNSToml struct { Type string `mapstructure:"type" toml:"type" validate:"oneof='default' 'dot' 'doh',required"` Server string `mapstructure:"server" toml:"server" validate:"omitempty,required,hostname|hostname_rfc1123|fqdn,required"` Addr string `mapstructure:"addr" toml:"addr" validate:"omitempty,required,ip|ip_addr|tcp_addr|udp_addr,required"` }
type LogTOML ¶
type ServerTOML ¶
type ServerTOML struct { Port int `mapstructure:"port" toml:"port" validate:"numeric,gte=0,lte=65535,required"` AdminPassword string `mapstructure:"admin_password" toml:"pretend" validate:"required"` }
func (*ServerTOML) Init ¶
func (st *ServerTOML) Init() (sg *serverGo, err error)
Click to show internal directories.
Click to hide internal directories.