Documentation ¶
Overview ¶
Package container contains source code for initializing all dependencies of out application. A bit more for each file included in this pkg.
File config.go Config contains structs that will be filled during application startup. At the current moment, config get all the variables from environment variables. List of environment variable for the local development can be specified in .env file. Also, environment variables can be in OS environment variables, then they will also appear in the Config struct.
File container.go Container initialize all the application dependencies and stores them in defined structures. The Container contains some default structures for storing dependencies inside, but you can define your own.
File dependencies.go Contains definition of each application dependency. All the functions use the Container for setup own dependencies.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ApplicationServices ¶
type ApplicationServices struct { }
type Config ¶
type Container ¶
type Container struct { Config Config Apps *Apps Clients *Clients Storages *Storages Services *Services AppServices *ApplicationServices Databus *Broker }
func NewContainer ¶
func NewContainer() *Container
type DB ¶
type DB struct { Schema string `env:"DATABASE_SCHEMA" envDefault:"public"` Database string `env:"PGDATABASE" envDefault:"postgres"` Host string `env:"PGHOST" envDefault:"localhost"` Port string `env:"PGPORT" envDefault:"5432"` User string `env:"PGUSER" evnDefault:"postgres"` Password string `env:"PGPASSWORD" envDefault:"postgres"` MaxOpenedConnections int `env:"DATABASE_MAX_OPENED_CONNECTIONS" envDefault:"10"` MaxIdleTimeout time.Duration `env:"DATABASE_MAX_IDLE_TIMEOUT" envDefault:"5m"` }