Documentation
¶
Index ¶
Constants ¶
const DatabaseMigrationTable = "migrations"
The DatabaseMigrationTable name is baked into the binary This setting should always be in sync with dbconfig.yml, sqlboiler.toml and the live database (e.g. to be able to test producation dumps locally)
Variables ¶
var DatabaseMigrationFolder = filepath.Join(util.GetProjectRootDir(), "/migrations")
The DatabaseMigrationFolder (folder with all *.sql migrations). This settings should always be in sync with dbconfig.yaml and Dockerfile (the final app stage). It's expected that the migrations folder lives at the root of this project or right next to the app binary.
Functions ¶
This section is empty.
Types ¶
type AuthServer ¶
type AuthServer struct { AccessTokenValidity time.Duration RefreshTokenValidity time.Duration PasswordResetTokenValidity time.Duration PasswordResetTokenDebounceDuration time.Duration PasswordResetTokenReuseDuration time.Duration DefaultUserScopes []string LastAuthenticatedAtThreshold time.Duration }
type Database ¶
type Database struct { Host string Port int Username string Password string `json:"-"` // sensitive Database string AdditionalParams map[string]string `json:",omitempty"` // Optional additional connection parameters mapped into the connection string MaxOpenConns int MaxIdleConns int ConnMaxLifetime time.Duration }
func (Database) ConnectionString ¶
ConnectionString generates a connection string to be passed to sql.Open or equivalents, assuming Postgres syntax
type EchoServer ¶
type EchoServer struct { Debug bool ListenAddress string HideInternalServerErrorDetails bool BaseURL string EnableCORSMiddleware bool EnableLoggerMiddleware bool EnableRecoverMiddleware bool EnableRequestIDMiddleware bool EnableTrailingSlashMiddleware bool EnableSecureMiddleware bool EnableCacheControlMiddleware bool SecureMiddleware EchoServerSecureMiddleware }
type EchoServerSecureMiddleware ¶
type EchoServerSecureMiddleware struct { XSSProtection string ContentTypeNosniff string XFrameOptions string HSTSMaxAge int HSTSExcludeSubdomains bool ContentSecurityPolicy string CSPReportOnly bool HSTSPreloadEnabled bool ReferrerPolicy string }
EchoServerSecureMiddleware represents a subset of echo's secure middleware config relevant to the app server. https://github.com/labstack/echo/blob/master/middleware/secure.go
type LoggerServer ¶
type Server ¶
type Server struct { Database Database Echo EchoServer Auth AuthServer Logger LoggerServer }
func DefaultServiceConfigFromEnv ¶
func DefaultServiceConfigFromEnv() Server