appconf

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2026 License: MIT Imports: 6 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const ServiceName = "game-library-auth"

ServiceName - service name

Variables

This section is empty.

Functions

This section is empty.

Types

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 related to authentication and authorization

type Cfg

type Cfg struct {
	DB          DB          `mapstructure:",squash"`
	Web         Web         `mapstructure:",squash"`
	Auth        Auth        `mapstructure:",squash"`
	OAuth       OAuth       `mapstructure:",squash"`
	Jaeger      Jaeger      `mapstructure:",squash"`
	Graylog     Graylog     `mapstructure:",squash"`
	Log         Log         `mapstructure:",squash"`
	EmailSender EmailSender `mapstructure:",squash"`
	InfoAPI     InfoAPI     `mapstructure:",squash"`
}

Cfg - app configuration

func Get

func Get() (*Cfg, error)

Get returns application config

func (*Cfg) Validate

func (cfg *Cfg) Validate() error

Validate validates configuration

type DB

type DB struct {
	DSN string `mapstructure:"DB_DSN"`
}

DB represents settings related to database

type EmailSender

type EmailSender struct {
	APIToken          string        `mapstructure:"EMAIL_SENDER_API_TOKEN"`
	APITimeout        time.Duration `mapstructure:"EMAIL_SENDER_API_TIMEOUT"`
	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 email sending service

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 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 related to OAuth providers

type Web

type Web struct {
	HTTPAddress           string        `mapstructure:"APP_HTTP_ADDRESS"`
	GRPCAddress           string        `mapstructure:"APP_GRPC_ADDRESS"`
	DebugAddress          string        `mapstructure:"APP_DEBUG_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 related to web server

Jump to

Keyboard shortcuts

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