config

package
v0.0.0-...-9518a5e Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// PostgresProvider is the string used to refer to postgres.
	PostgresProvider = "postgres"
	// MySQLProvider is the string used to refer to MySQL.
	MySQLProvider = "mysql"
)

Variables

View Source
var (
	// Providers represents this package's offering to the dependency manager.
	Providers = wire.NewSet(
		ProvideSessionManager,
	)
)

Functions

func ProvideSessionManager

func ProvideSessionManager(cookieConfig authservice.CookieConfig, dm database.DataManager) (*scs.SessionManager, error)

ProvideSessionManager provides a session manager based on some settings. There's not a great place to put this function. I don't think it belongs in Auth because it accepts a DB connection, but it obviously doesn't belong in the database package, or maybe it does.

Types

type Config

type Config struct {
	CreateTestUser    *types.TestUserCreationConfig `json:"create_test_user" mapstructure:"create_test_user" toml:"create_test_user,omitempty"`
	Provider          string                        `json:"provider" mapstructure:"provider" toml:"provider,omitempty"`
	ConnectionDetails database.ConnectionDetails    `json:"connection_details" mapstructure:"connection_details" toml:"connection_details,omitempty"`
	Debug             bool                          `json:"debug" mapstructure:"debug" toml:"debug,omitempty"`
	RunMigrations     bool                          `json:"run_migrations" mapstructure:"run_migrations" toml:"run_migrations,omitempty"`
	MaxPingAttempts   uint8                         `json:"max_ping_attempts" mapstructure:"max_ping_attempts" toml:"max_ping_attempts,omitempty"`
	// contains filtered or unexported fields
}

Config represents our database configuration.

func (*Config) ValidateWithContext

func (cfg *Config) ValidateWithContext(ctx context.Context) error

ValidateWithContext validates an DatabaseSettings struct.

Jump to

Keyboard shortcuts

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