configs

package
v0.8.3 Latest Latest
Warning

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

Go to latest
Published: May 8, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DriverPostgres = "postgres"
	DriverMysql    = "mysql"
	DriverSqlite   = "sqlite"
)
View Source
const (
	ApplicationName = "authz"
)

Variables

This section is empty.

Functions

func FxModule

func FxModule() fx.Option

Types

type App

type App struct {
	AuditCleanDelay            time.Duration `config:"app_audit_clean_delay"`
	AuditCleanDaysToKeep       int           `config:"app_audit_clean_days_to_keep"`
	AuditFlushDelay            time.Duration `config:"app_audit_flush_delay"`
	AuditResourceKindRegex     string        `config:"app_audit_resource_kind_regex"`
	DispatcherEventChannelSize int           `config:"dispatcher_event_channel_size"`
	MetricsEnabled             bool          `config:"app_metrics_enabled"`
	StatsCleanDelay            time.Duration `config:"app_stats_clean_delay"`
	StatsCleanDaysToKeep       int           `config:"app_stats_clean_days_to_keep"`
	StatsFlushDelay            time.Duration `config:"app_stats_flush_delay"`
	StatsResourceKindRegex     string        `config:"app_stats_resource_kind_regex"`
	TraceEnabled               bool          `config:"app_trace_enabled"`
	TraceExporter              string        `config:"app_trace_exporter"`
	TraceJaegerURL             string        `config:"app_trace_jaeger_url"`
	TraceOtlpDialTimeout       time.Duration `config:"app_trace_otlp_dial_timeout"`
	TraceOtlpEndpoint          string        `config:"app_trace_otlp_endpoint"`
	TraceZipkinURL             string        `config:"app_trace_zipkin_url"`
	TraceSampleRatio           float64       `config:"app_trace_sample_ratio"`
}

type Auth

type Auth struct {
	AccessTokenDuration  time.Duration `config:"auth_access_token_duration"`
	RefreshTokenDuration time.Duration `config:"auth_refresh_token_duration"`
	Domain               string        `config:"auth_domain"`
	JWTSignString        []byte        `config:"auth_jwt_sign_string"`
}

type Base

type Base struct {
	App        *App
	Auth       *Auth
	Database   *Database
	Logger     *Logger
	GRPCServer *GRPCServer
	HTTPServer *HTTPServer
	OAuth      *OAuth
	User       *User
}

func Load

func Load(ctx context.Context) *Base

type Database

type Database struct {
	Driver   string `config:"database_driver"`
	Host     string `config:"database_host"`
	Port     string `config:"database_port"`
	SSLMode  string `config:"database_ssl"`
	User     string `config:"database_user"`
	Password string `config:"database_password"`
	Dbname   string `config:"database_name"`
	Timezone string `config:"database_timezone"`
}

func (Database) MysqlDSN

func (d Database) MysqlDSN() string

func (Database) PostgresDSN

func (d Database) PostgresDSN() string

func (Database) SqliteDSN

func (d Database) SqliteDSN() string

type GRPCServer

type GRPCServer struct {
	Addr string `config:"grpc_server_addr"`
}

type HTTPServer

type HTTPServer struct {
	Addr                 string        `config:"http_server_addr"`
	CORSAllowedDomains   []string      `config:"http_server_cors_allowed_domains"`
	CORSAllowedMethods   []string      `config:"http_server_cors_allowed_methods"`
	CORSAllowedHeaders   []string      `config:"http_server_cors_allowed_headers"`
	CORSAllowCredentials bool          `config:"http_server_cors_allow_credentials"`
	CORSCacheMaxAge      time.Duration `config:"http_server_cors_cache_max_age"`
}

type Logger

type Logger struct {
	Level string `config:"logger_level"`
}

type OAuth

type OAuth struct {
	ClientID            string   `config:"oauth_client_id"`
	ClientSecret        string   `config:"oauth_client_secret"`
	CookiesDomainName   string   `config:"oauth_cookies_domain_name"`
	FrontendRedirectURL string   `config:"oauth_frontend_redirect_url"`
	IssuerURL           string   `config:"oauth_issuer_url"`
	RedirectURL         string   `config:"oauth_redirect_url"`
	Scopes              []string `config:"oauth_scopes"`
}

type User

type User struct {
	AdminDefaultPassword string `config:"user_admin_default_password"`
}

Jump to

Keyboard shortcuts

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