Documentation
¶
Index ¶
Constants ¶
const ServiceName = "game-library-auth"
ServiceName - service name
Variables ¶
This section is empty.
Functions ¶
Types ¶
type API ¶ added in v1.2.0
type API struct {
Log Log `mapstructure:",squash"`
DB DB `mapstructure:",squash"`
Web Web `mapstructure:",squash"`
Debug Debug `mapstructure:",squash"`
Auth Auth `mapstructure:",squash"`
OAuth OAuth `mapstructure:",squash"`
Jaeger Jaeger `mapstructure:",squash"`
Graylog Graylog `mapstructure:",squash"`
EmailSender EmailSender `mapstructure:",squash"`
InfoAPI InfoAPI `mapstructure:",squash"`
}
API - api service configuration
type Auth ¶
type Auth struct {
PrivateKeyFile string `mapstructure:"AUTH_PRIVATEKEYFILE"`
SigningAlgorithm string `mapstructure:"AUTH_SIGNINGALG"`
Issuer string `mapstructure:"AUTH_ISSUER"`
AccessTokenTTL time.Duration `mapstructure:"AUTH_ACCESSTOKENTTL"`
RefreshTokenTTL time.Duration `mapstructure:"AUTH_REFRESHTOKENTTL"`
}
Auth represents settings for authentication and authorization
type Debug ¶ added in v1.2.0
type Debug struct {
Address string `mapstructure:"APP_DEBUG_ADDRESS"`
}
Debug represents settings for debug server (pprof, metrics, health probes)
type EmailDelivery ¶ added in v1.2.0
type EmailDelivery struct {
APIToken string `mapstructure:"EMAIL_SENDER_API_TOKEN"`
APITimeout time.Duration `mapstructure:"EMAIL_SENDER_API_TIMEOUT"`
}
EmailDelivery represents settings for email provider client
func (EmailDelivery) Validate ¶ added in v1.2.0
func (c EmailDelivery) Validate() error
Validate validates email delivery settings. Timeout must not outlive a worker attempt
type EmailSender ¶
type EmailSender struct {
EmailFrom string `mapstructure:"EMAIL_SENDER_EMAIL_FROM"`
ContactEmail string `mapstructure:"EMAIL_SENDER_CONTACT_EMAIL"`
BaseURL string `mapstructure:"EMAIL_SENDER_BASE_URL"`
UnsubscribeURL string `mapstructure:"EMAIL_SENDER_UNSUBSCRIBE_URL"`
UnsubscribeSecret string `mapstructure:"EMAIL_SENDER_UNSUBSCRIBE_SECRET"`
}
EmailSender represents settings for composing emails
func (EmailSender) Validate ¶ added in v1.2.0
func (c EmailSender) Validate() error
Validate validates email sender settings
type Graylog ¶
type Graylog struct {
Address string `mapstructure:"GRAYLOG_ADDR"`
}
Graylog represents settings related to Graylog integration
type InfoAPI ¶
type InfoAPI struct {
Address string `mapstructure:"INFOAPI_ADDRESS"`
Timeout time.Duration `mapstructure:"INFOAPI_TIMEOUT"`
}
InfoAPI represents settings for InfoAPI gRPC client
type Jaeger ¶
type Jaeger struct {
OTLPEndpoint string `mapstructure:"JAEGER_OTLP_ENDPOINT"`
}
Jaeger represents settings for Jaeger OTLP trace export
type Log ¶
type Log struct {
Level string `mapstructure:"LOG_LEVEL"`
}
Log represents settings for logging
type Manage ¶ added in v1.2.0
type Manage struct {
DB DB `mapstructure:",squash"`
}
Manage - database management tool configuration
type OAuth ¶
type OAuth struct {
Timeout time.Duration `mapstructure:"OAUTH_TIMEOUT"`
GoogleClientID string `mapstructure:"OAUTH_GOOGLECLIENTID"`
GitHubClientID string `mapstructure:"OAUTH_GITHUBCLIENTID"`
GitHubClientSecret string `mapstructure:"OAUTH_GITHUBCLIENTSECRET"`
}
OAuth represents settings for OAuth providers
type Web ¶
type Web struct {
HTTPAddress string `mapstructure:"APP_HTTP_ADDRESS"`
GRPCAddress string `mapstructure:"APP_GRPC_ADDRESS"`
ReadTimeout time.Duration `mapstructure:"APP_READTIMEOUT"`
WriteTimeout time.Duration `mapstructure:"APP_WRITETIMEOUT"`
AllowedCORSOrigin string `mapstructure:"APP_ALLOWEDCORSORIGIN"`
RefreshCookieSameSite string `mapstructure:"APP_REFRESH_TOKEN_COOKIE_SAMESITE"`
RefreshCookieSecure bool `mapstructure:"APP_REFRESH_TOKEN_COOKIE_SECURE"`
}
Web represents settings for web server
type Worker ¶ added in v1.2.0
type Worker struct {
Log Log `mapstructure:",squash"`
DB DB `mapstructure:",squash"`
Debug Debug `mapstructure:",squash"`
Jaeger Jaeger `mapstructure:",squash"`
Graylog Graylog `mapstructure:",squash"`
EmailDelivery EmailDelivery `mapstructure:",squash"`
}
Worker - notification worker configuration. Deliberately omits JWT keys, OAuth and downstream API credentials