Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type API ¶
type API struct { IP string `toml:"ip"` Port uint16 `toml:"port"` User string `toml:"user"` Token string `toml:"token"` }
API : Rest API config
type ConfigToml ¶
type ConfigToml struct { Project Project // Versions Versions API API DNS DNS Keys Keys Server Server Database Database Modules map[string]Module TLSParams TLSParams Algorithm Algorithm }
ConfigToml is the global config object
func LoadConfig ¶
func LoadConfig(file string) (ConfigToml, error)
LoadConfig load the configuration file !
func (*ConfigToml) TLSBuildClientConf ¶
func (c *ConfigToml) TLSBuildClientConf() (*tls.Config, error)
Build the TLS configuration for server
func (*ConfigToml) TLSBuildServerConf ¶
func (c *ConfigToml) TLSBuildServerConf() (*tls.Config, error)
Build the TLS configuration for server
func (*ConfigToml) TLSReadCAFile ¶
func (c *ConfigToml) TLSReadCAFile(caCert string) (*x509.CertPool, error)
Read CA file and initialise
type Database ¶
type Database struct { User string `toml:"user"` Database string `toml:"database"` DatabaseType string `toml:"databaseType"` Password string `toml:"password"` IP string `toml:"ip"` Port uint16 `toml:"port"` }
Database : Mongodb config
type Module ¶
type Module struct {
Enabled bool `toml:"enabled" json:"enabled"`
}
Module : Basic struct for general module config
type Server ¶
type Server struct { Password string `toml:"password"` IP string `toml:"ip"` Port uint16 `toml:"port"` }
Server : Master node config
type TLSParams ¶
type TLSParams struct { // Enable TLS communications or not UseTLS bool `toml:"usetls"` // TLS Configuration to be set later TLSConfig *tls.Config // Certifcation Authority and Server Certificates CaCert string `toml:"caCert"` ServerCert string `toml:"serverCert"` // These will later be deleted to be load dynamically for server and clients ServerPrivateKey string `toml:"serverPrivateKey"` ClientCert string `toml:"clientCert"` ClientPrivateKey string `toml:"clientPrivateKey"` }
TLS Certificates and keys
Click to show internal directories.
Click to hide internal directories.