Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( ModuleName = "build.local/misses/ldflags" // e.g. "github.com/trino-network/pay-srv" Commit = "< 40 chars git commit hash via ldflags >" // e.g. "59cb7684dd0b0f38d68cd7db657cb614feba8f7e" BuildDate = "1970-01-01T00:00:00+00:00" // e.g. "1970-01-01T00:00:00+00:00" )
The following vars are automatically injected via -ldflags. See Makefile target "make go-build" and make var $(LDFLAGS). No need to change them here. https://www.digitalocean.com/community/tutorials/using-ldflags-to-set-version-information-for-go-applications
Functions ¶
func GetFormattedBuildArgs ¶
func GetFormattedBuildArgs() string
GetFormattedBuildArgs returns string representation of buildsargs set via ldflags "<ModuleName> @ <Commit> (<BuildDate>)"
Types ¶
type AuthServer ¶
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 FrontendServer ¶
type LoggerServer ¶
type MailerTransporter ¶
type MailerTransporter string
var ( MailerTransporterMock MailerTransporter = "mock" MailerTransporterSMTP MailerTransporter = "SMTP" )
func (MailerTransporter) String ¶
func (m MailerTransporter) String() string
type ManagementServer ¶
type PathsServer ¶
type PprofServer ¶
type PushService ¶
type Server ¶
type Server struct { Database Database Echo EchoServer Pprof PprofServer Paths PathsServer Auth AuthServer Management ManagementServer Mailer Mailer SMTP transport.SMTPMailTransportConfig Frontend FrontendServer Logger LoggerServer Push PushService FCMConfig provider.FCMConfig I18n I18n }
func DefaultServiceConfigFromEnv ¶
func DefaultServiceConfigFromEnv() Server
DefaultServiceConfigFromEnv returns the server config as parsed from environment variables and their respective defaults defined below. We don't expect that ENV_VARs change while we are running our application or our tests (and it would be a bad thing to do anyways with parallel testing). Do NOT use os.Setenv / os.Unsetenv in tests utilizing DefaultServiceConfigFromEnv()! We can optimize here to do ENV_VAR parsing only once.