config

package
v0.0.0-...-e012b55 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2024 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Wire     WireConfig      `koanf:"wire"`
	Log      log.Config      `koanf:"log"`
	HTTP     HTTPConfig      `koanf:"http"`
	Postgres postgres.Config `koanf:"postgres"`
	Redis    redis.Config    `koanf:"redis"`
	Google   GoogleConfig    `koanf:"google"`
	JWT      jwt.Config      `koanf:"jwt"`
	OAuth    OAuthConfig     `koanf:"oauth"`
	Cron     CronConfig      `koanf:"cron"`
}

func LoadValidated

func LoadValidated(dir string) (*Config, error)

func (*Config) ToAuthServiceConfig

func (c *Config) ToAuthServiceConfig() auth.Config

func (*Config) ToCronConfig

func (c *Config) ToCronConfig() cron.Config

func (*Config) ToGoogleClientConfig

func (c *Config) ToGoogleClientConfig() google.ClientConfig

func (*Config) ToHTTPConfig

func (c *Config) ToHTTPConfig() http.Config

func (*Config) ToJWTConfig

func (c *Config) ToJWTConfig() jwt.Config

func (*Config) ToLogConfig

func (c *Config) ToLogConfig() log.Config

func (*Config) ToPostgresConfig

func (c *Config) ToPostgresConfig() postgres.Config

func (*Config) ToRedisConfig

func (c *Config) ToRedisConfig() redis.Config

type CronConfig

type CronConfig struct {
	TagCleanupInterval time.Duration `koanf:"tag-cleanup-interval" validate:"required,min=1m"`
}

type GoogleConfig

type GoogleConfig struct {
	Endpoints GoogleEndpointsConfig `koanf:"endpoints"`
	OAuth     GoogleOAuthConfig     `koanf:"oauth"`
}

type GoogleEndpointsConfig

type GoogleEndpointsConfig struct {
	Token string `koanf:"token" validate:"required"`
	OAuth string `koanf:"oauth" validate:"required"`
}

type GoogleOAuthConfig

type GoogleOAuthConfig struct {
	ClientID     string `koanf:"client-id" validate:"required"`
	ClientSecret string `koanf:"client-secret" validate:"required"`
}

type HTTPConfig

type HTTPConfig struct {
	Port int `koanf:"port" validate:"required"`
}

type OAuthConfig

type OAuthConfig struct {
	StateTimeout time.Duration `koanf:"state-timeout" validate:"required,min=1m"`
	CallbackPath string        `koanf:"callback-path" validate:"required"`
}

type WireConfig

type WireConfig struct {
	InitializeTimeout time.Duration `koanf:"initialize-timeout" validate:"required"`
	ShutdownTimeout   time.Duration `koanf:"shutdown-timeout" validate:"required"`
}

Jump to

Keyboard shortcuts

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