config

package
v0.0.0-...-998db2a Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ServerHostname   = "server.hostname"
	DatabaseHost     = "database.host"
	DatabaseName     = "database.name"
	DatabaseUser     = "database.user"
	DatabasePassword = "database.password"
	DatabasePort     = "database.port"
	DatabaseSslMode  = "database.sslmode"

	SecurityTokenExpiration = "security.token_expiration"
	SecuritySecret          = "security.secret"

	JobEnabled   = "job.enabled"
	JobBroker    = "job.broker"
	JobStore     = "job.store"
	JobQueueName = "job.queue_name"

	MessageQueue = "message.queue"

	SmtpFrom       = "smtp.from"
	SmtpHost       = "smtp.host"
	SmtpPort       = "smtp.port"
	SmtpUsername   = "smtp.username"
	SmtpPassword   = "smtp.password"
	SmtpSkipVerify = "false"
)

Variables

This section is empty.

Functions

func InitDefaults

func InitDefaults()

Types

type AppConfig

type AppConfig struct {
	Email        EmailConfig
	Security     SecurityConfig
	Database     DatabaseConfig
	Job          JobConfig
	MessageQueue MessageQueueConfig
}

func GetAppConfig

func GetAppConfig() (AppConfig, error)

type DatabaseConfig

type DatabaseConfig struct {
	Host     string
	Port     string
	Name     string
	Username string
	Password string
	SslMode  string
}

func GetDatabaseConfig

func GetDatabaseConfig() DatabaseConfig

func (DatabaseConfig) GetDatabaseConnectionUri

func (cfg DatabaseConfig) GetDatabaseConnectionUri() string

type EmailConfig

type EmailConfig struct {
	Host               string
	Port               int
	From               string
	Username           string
	Password           string
	SiteURL            string
	InsecureSkipVerify bool
}

func GetEmailConfig

func GetEmailConfig() EmailConfig

type JobConfig

type JobConfig struct {
	Enabled   bool
	Broker    string
	QueueName string
	Store     string
}

func GetJobConfig

func GetJobConfig() JobConfig

func (*JobConfig) GetJobConfig

func (cfg *JobConfig) GetJobConfig() mConfig.Config

type MessageQueueConfig

type MessageQueueConfig struct {
	URI string
}

func (MessageQueueConfig) GetMessageQueueClient

func (c MessageQueueConfig) GetMessageQueueClient() (*redis.Client, error)

type SecurityConfig

type SecurityConfig struct {
	AccessTokenExpiration time.Duration
	Secret                []byte
}

func GetSecurityConfig

func GetSecurityConfig(accessTokenExp string, secret []byte) (SecurityConfig, error)

Jump to

Keyboard shortcuts

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