Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Module = fx.Options( fx.Provide(NewConfig), fx.Provide(NewHttpHandler), fx.Provide(NewMail), fx.Provide(NewDatabase), fx.Provide(NewMigration), )
Functions ¶
func GetVersion ¶
func SetConfigPath ¶
func SetConfigPath(path string)
Types ¶
type AuthConfig ¶
type Config ¶
type Config struct {
Name string `mapstructure:"Name"`
Secret string `mapstructure:"Secret"`
Http *HttpConfig `mapstructure:"Http"`
Database *DatabaseConfig `mapstructure:"Database"`
Auth *AuthConfig `mapstructure:"Auth"`
Cors *CorsConfig `mapstructure:"Cors"`
Swagger *SwaggerConfig `mapstructure:"Swagger"`
Mail *MailConfig `mapstructure:"Mail"`
}
type CorsConfig ¶
type Database ¶
func NewDatabase ¶
type DatabaseConfig ¶
type DatabaseConfig struct {
Name string `mapstructure:"Name"`
Host string `mapstructure:"Host"`
Port int `mapstructure:"Port"`
Username string `mapstructure:"Username"`
Password string `mapstructure:"Password"`
SslMode string `mapstructure:"SslMode"`
TimeZone string `mapstructure:"TimeZone"`
MigrationDir string `mapstructure:"MigrationDir"`
}
func (DatabaseConfig) DSN ¶
func (d 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 (h HttpConfig) ListenAddr() string
type HttpHandler ¶
func NewHttpHandler ¶
func NewHttpHandler() 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)
Click to show internal directories.
Click to hide internal directories.