kaoriSettings

package module
v0.0.0-...-1aee6c4 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2021 License: Apache-2.0 Imports: 9 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckPrecedentConfig

func CheckPrecedentConfig(pathConfig string) error

Types

type Config

type Config struct {
	Server   ServerConfig   `yaml:"server" json:"server,omitempty"`
	Logger   LoggerConfig   `yaml:"logger" json:"logger,omitempty"`
	Database DatabaseConfig `yaml:"database" json:"database,omitempty"`
	Password PasswordConfig `yaml:"password" json:"password,omitempty"`
	Mail     MailConfig     `yaml:"mail" json:"mail,omitempty"`
	Template TemplateConfig `yaml:"template" json:"template,omitempty"`
	Jwt      JWTConfig      `yaml:"jwt" json:"jwt,omitempty"`
}

Config è una struttura con le impostazioni del software.

func NewConfig

func NewConfig(pathConfig string) (*Config, error)

NewConfig è un costruttore dell'oggetto config.

func (*Config) CheckConfig

func (cfg *Config) CheckConfig() error

CheckConfig controlla la validità di tutte le configurazioni.

func (*Config) WriteConfig

func (conf *Config) WriteConfig() (wdone []string, err error)

WriteConfig Scrive tutti i settaggi nei relativi file.

func (*Config) WriteDatabaseConf

func (conf *Config) WriteDatabaseConf() error

WriteDatabaseConf Scrive i settaggi dei database nel relativo file.

type DBNonRealtional

type DBNonRealtional struct {
	ProjectId string `yaml:"projectId" json:"projectId,omitempty"`
	Key       string `yaml:"key" json:"key,omitempty"`
}

func (*DBNonRealtional) CheckDatabase

func (db *DBNonRealtional) CheckDatabase() error

CheckDatabase controlla che tutte le impostazioni del database siano corrette.

func (*DBNonRealtional) CheckDatabaseKey

func (db *DBNonRealtional) CheckDatabaseKey() error

CheckDatabase controlla che esista il file che contiene la key del database.

func (*DBNonRealtional) CheckDatabaseProjectId

func (db *DBNonRealtional) CheckDatabaseProjectId() error

CheckDatabase controlla che projectId sia corretto.

type DBRelational

type DBRelational struct {
	Username string `yaml:"username" json:"username"`
	Password string `yaml:"password" json:"password"`
	Host     string `yaml:"host" json:"host"`
	Port     string `yaml:"port" json:"port"`
	Db       string `yaml:"db" json:"db"`
	Driver   string `yaml:"driver" json:"driver"`
}

func (*DBRelational) CheckDBName

func (db *DBRelational) CheckDBName() error

func (*DBRelational) CheckDatabase

func (db *DBRelational) CheckDatabase() error

func (*DBRelational) CheckDriver

func (db *DBRelational) CheckDriver() error

func (*DBRelational) CheckHost

func (db *DBRelational) CheckHost() error

func (*DBRelational) CheckPort

func (db *DBRelational) CheckPort() error

type DatabaseConfig

type DatabaseConfig struct {
	Relational    []DBRelational    `yaml:"relational" json:"relational"`
	NonRelational []DBNonRealtional `yaml:"nonRelational" json:"nonRelational"`
}

DatabaseConfig è una struttura con le impostazioni del database.

type HTMLTemplateConfig

type HTMLTemplateConfig map[string]string

HTMLTemplateConfig è una struttura con le impostazioni dei template html.

func (HTMLTemplateConfig) CheckHTMLTemplate

func (tmplh HTMLTemplateConfig) CheckHTMLTemplate() error

CheckHTMLTemplate controlla tutte le impostazioni dei template html.

type JWTConfig

type JWTConfig struct {
	Iss     string       `yaml:"iss" json:"iss,omitempty"`
	Company string       `yaml:"company" json:"company,omitempty"`
	Exp     JWTExpConfig `yaml:"exp" json:"exp,omitempty"`
}

JWTConfig è una struttura con le impostazioni del JWT.

func (*JWTConfig) WriteConf

func (jwtConf *JWTConfig) WriteConf() error

WriteConf Scrive i settaggi del JWT nel relativo file.

type JWTExpConfig

type JWTExpConfig struct {
	AccessToken  int `yaml:"accessToken" json:"accessToken,omitempty"`
	RefreshToken int `yaml:"refreshToken" json:"refreshToken,omitempty"`
}

JWTExpConfig è una struttura con le impostazioni di scadenza dei JWT.

type LoggerConfig

type LoggerConfig struct {
	Connection string `yaml:"connection" json:"connection,omitempty"`
	Server     string `yaml:"server" json:"server,omitempty"`
}

LoggerConfig è una struttura con le impostazioni del logger.

func (*LoggerConfig) CheckLogger

func (lo *LoggerConfig) CheckLogger() error

CheckLogger controlla se esistono tutte le path di log impostate nel file di configurazione.

func (*LoggerConfig) CheckLoggerConnection

func (lo *LoggerConfig) CheckLoggerConnection() error

CheckLoggerConnection controlla se esiste la path di log delle connessioni impostata nel file di configurazione.

func (*LoggerConfig) CheckLoggerServer

func (lo *LoggerConfig) CheckLoggerServer() error

CheckLoggerServer controlla se esiste la path di log del server impostata nel file di configurazione.

func (*LoggerConfig) WriteConf

func (logConf *LoggerConfig) WriteConf() error

WriteConf Scrive i settaggi del logger nel relativo file.

type MailConfig

type MailConfig struct {
	Address    string           `yaml:"address" json:"address,omitempty"`
	SmtpServer SMTPServerConfig `yaml:"smtpServer" json:"smtpServer,omitempty"`
}

MailConfig è una struttura con le impostazioni della mail.

func (*MailConfig) CheckMail

func (m *MailConfig) CheckMail() error

CheckMail controlla se tutte le impostazioni relative alle mail sono corrette.

func (*MailConfig) CheckMailAddress

func (m *MailConfig) CheckMailAddress() error

CheckMailAddress controlla che l'indirizzo della mail impostato nei file di configurazione sia valido.

func (*MailConfig) WriteConf

func (mailConf *MailConfig) WriteConf() error

WriteConf Scrive i settaggi delle mail nel relativo file.

type MailTemplateConfig

type MailTemplateConfig map[string]MailTemplateField

MusicTemplateConfig è una struttura con le impostazioni per i template relativi alle mail.

func (MailTemplateConfig) CheckMailTemplate

func (tmplm MailTemplateConfig) CheckMailTemplate() error

CheckMailTemplate controlla tutte le impostazioni dei mail template

type MailTemplateField

type MailTemplateField struct {
	File   string `yaml:"file" json:"file,omitempty"`
	Object string `yaml:"object" json:"object,omitempty"`
}

MailTemplateField è una struttura con le impostazioni per ogni template della mail.

func (*MailTemplateField) CheckAll

func (fm *MailTemplateField) CheckAll() error

CheckAll controlla tutte le impostazioni di un template mail.

func (*MailTemplateField) CheckFile

func (fm *MailTemplateField) CheckFile() error

CheckFile controlla l'impostazione "file" di un template mail.

func (*MailTemplateField) CheckObject

func (fm *MailTemplateField) CheckObject() error

CheckObject controlla l'oggetto della mail del template mail.

type MusicTemplateConfig

type MusicTemplateConfig map[string]string

MusicTemplateConfig è una struttura con le impostazioni per i template relativi alla musica.

func (MusicTemplateConfig) CheckMusicTemplate

func (tmplmu MusicTemplateConfig) CheckMusicTemplate() error

CheckMusicTemplate controlla tutte le impostazioni dei music template.

type PasswordConfig

type PasswordConfig struct {
	AccessToken  string `yaml:"accessToken" json:"accessToken,omitempty"`
	RefreshToken string `yaml:"refreshToken" json:"refreshToken,omitempty"`
	Cookies      string `yaml:"cookies" json:"cookies,omitempty"`
	Mail         string `yaml:"mail" json:"mail,omitempty"`
	Oauth        string `yaml:"oauth" json:"oauth"`
}

PasswordConfig è una struttura dove sono impostate le password del software.

func (*PasswordConfig) CheckPassword

func (psw *PasswordConfig) CheckPassword() error

CheckPassword controlla se tutte le password nel database sono corrette.

func (*PasswordConfig) WriteConf

func (passConf *PasswordConfig) WriteConf() error

WriteConf Scrive i settaggi delle password nel relativo file.

type SMTPServerConfig

type SMTPServerConfig struct {
	Host string `yaml:"host" json:"host,omitempty"`
	Port string `yaml:"port" json:"port,omitempty"`
}

SMTPServerConfig è una struttura con le impostazioni per il server mail SMTP.

func (*SMTPServerConfig) CheckMailSMTP

func (sm *SMTPServerConfig) CheckMailSMTP() error

CheckMailSMTP controlla che tutte le impostazioni del server smtp siano corrette.

func (*SMTPServerConfig) CheckMailSMTPHost

func (sm *SMTPServerConfig) CheckMailSMTPHost() error

CheckMailSMTPHost Controlla che l'impostazione "host" del server SMTP sia corretta.

func (*SMTPServerConfig) CheckMailSMTPPort

func (sm *SMTPServerConfig) CheckMailSMTPPort() error

CheckMailSMTPPort Controlla che l'impostazione "port" del server SMTP sia corretta.

type SSLConfig

type SSLConfig struct {
	Certificate string `yaml:"certificate" json:"certificate,omitempty"`
	Key         string `yaml:"key" json:"key,omitempty"`
}

SSLConfig è una struttura con le impostazioni dei certificati SSL.

func (*SSLConfig) CheckSSL

func (ssl *SSLConfig) CheckSSL() error

CheckSSL controlla tutte le impostazioni SSL del server.

type ServerConfig

type ServerConfig struct {
	Host     string    `yaml:"host" json:"host,omitempty"`
	Port     string    `yaml:"port" json:"port,omitempty"`
	Ssl      SSLConfig `yaml:"ssl" json:"ssl,omitempty"`
	Limiter  int       `yaml:"limiter" json:"limiter,omitempty"`
	Gui      string    `yaml:"gui" json:"gui,omitempty"`
	Test     string    `yaml:"test" json:"test,omitempty"`
	Template string    `yaml:"template" json:"template,omitempty"`
}

ServerConfig è una struttura con le impostazioni del server.

func (*ServerConfig) CheckGui

func (srv *ServerConfig) CheckGui() error

CheckGui controlla la path gui del server.

func (*ServerConfig) CheckHost

func (srv *ServerConfig) CheckHost() error

CheckHost controlla l'impostazione host del server.

func (*ServerConfig) CheckLimiter

func (srv *ServerConfig) CheckLimiter() error

CheckLimiter controlla tutte le impostazioni del limiter del server.

func (*ServerConfig) CheckPort

func (srv *ServerConfig) CheckPort() error

CheckPort controlla l'impostazione porta del server.

func (*ServerConfig) CheckServer

func (srv *ServerConfig) CheckServer() error

CheckServer controlla la validità di tutte le impostazioni relative al server.

func (*ServerConfig) CheckTemplate

func (srv *ServerConfig) CheckTemplate() error

CheckTemplate controlla la path template del server.

func (*ServerConfig) CheckTest

func (srv *ServerConfig) CheckTest() error

CheckTest controlla la path test del server

func (*ServerConfig) WriteConf

func (srvConf *ServerConfig) WriteConf() error

WriteConf Scrive i settaggi del server nel relativo file.

type TemplateConfig

type TemplateConfig struct {
	Mail  MailTemplateConfig  `yaml:"mail" json:"mail,omitempty"`
	Music MusicTemplateConfig `yaml:"music" json:"music,omitempty"`
	Html  HTMLTemplateConfig  `yaml:"html" json:"html,omitempty"`
}

TemplateConfig è una struttura con le impostazioni dei template.

func (*TemplateConfig) CheckTemplate

func (tmpl *TemplateConfig) CheckTemplate() error

CheckTemplate controlla tutte le impostazioni di tutti i template.

func (*TemplateConfig) WriteConf

func (tempConf *TemplateConfig) WriteConf() error

WriteConf Scrive i settaggi dei template nel relativo file.

Jump to

Keyboard shortcuts

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