Documentation
¶
Index ¶
- Variables
- func GetVersion(filename string) (int64, error)
- func SetConfigPath(path string)
- type AuthConfig
- type BinderWithValidation
- type Config
- type CorsConfig
- type Database
- type DatabaseConfig
- type HttpConfig
- type HttpHandler
- type LogConfig
- type Logger
- type Mail
- type MailConfig
- type MailTemplate
- type Migration
- type SwaggerConfig
- type Validator
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func GetVersion ¶
func SetConfigPath ¶
func SetConfigPath(path string)
Types ¶
type AuthConfig ¶
type BinderWithValidation ¶
type BinderWithValidation struct{}
type Config ¶
type Config struct {
Name string `mapstructure:"Name"`
Secret string `mapstructure:"Secret"`
Http *HttpConfig `mapstructure:"Http"`
Log *LogConfig `mapstructure:"Log"`
Database *DatabaseConfig `mapstructure:"Database"`
Mail *MailConfig `mapstructure:"Mail"`
Cors *CorsConfig `mapstructure:"Cors"`
Swagger *SwaggerConfig `mapstructure:"Swagger"`
Auth *AuthConfig `mapstructure:"Auth"`
}
type CorsConfig ¶
type Database ¶
func NewDatabase ¶
type DatabaseConfig ¶
type DatabaseConfig struct {
Engine string `mapstructure:"Engine"`
Name string `mapstructure:"Name"`
Host string `mapstructure:"Host"`
Port int `mapstructure:"Port"`
Username string `mapstructure:"Username"`
Password string `mapstructure:"Password"`
Parameters string `mapstructure:"Parameters"`
SslMode string `mapstructure:"SslMode"`
TimeZone string `mapstructure:"TimeZone"`
MigrationDir string `mapstructure:"MigrationDir"`
}
func (DatabaseConfig) DSN ¶
func (a DatabaseConfig) DSN() string
type HttpConfig ¶
type HttpConfig struct {
Host string `mapstructure:"Host" validate:"ipv4"`
Port int `mapstructure:"Port" validate:"gte=1,lte=65535"`
}
func (*HttpConfig) ListenAddr ¶
func (a *HttpConfig) ListenAddr() string
type HttpHandler ¶
func NewHttpHandler ¶
func NewHttpHandler(logger Logger) HttpHandler
type Mail ¶
type Mail struct {
// contains filtered or unexported fields
}
func (Mail) SendMailAsLog ¶
func (Mail) SendMailWithTemplate ¶
func (l Mail) SendMailWithTemplate(mailTemplate MailTemplate)
type MailConfig ¶
type MailTemplate ¶
type MailTemplate struct {
Subject string
Body string
Sender string
Receivers []string
Context map[string]interface{}
}
func (MailTemplate) GetBody ¶
func (m MailTemplate) GetBody() string
func (MailTemplate) GetSubject ¶
func (m MailTemplate) GetSubject() string
func (MailTemplate) ReadTemplate ¶
func (m MailTemplate) ReadTemplate(templateName string) (string, error)
type Migration ¶
type Migration struct {
// contains filtered or unexported fields
}
func NewMigration ¶
type SwaggerConfig ¶
Click to show internal directories.
Click to hide internal directories.