Documentation
¶
Index ¶
- Constants
- type AuthConfig
- type AuthProviderConfig
- type CheckConfig
- type Config
- type DatastoreConfig
- type MySQLConfig
- type PostgresConfig
- type SQLiteConfig
- type WarrantConfig
- func (warrantConfig WarrantConfig) GetAuthentication() *AuthConfig
- func (warrantConfig WarrantConfig) GetAutoMigrate() bool
- func (warrantConfig WarrantConfig) GetCheck() *CheckConfig
- func (warrantConfig WarrantConfig) GetDatastore() DatastoreConfig
- func (warrantConfig WarrantConfig) GetEnableAccessLog() bool
- func (warrantConfig WarrantConfig) GetLogLevel() int8
- func (warrantConfig WarrantConfig) GetPort() int
- type WarrantDatastoreConfig
Constants ¶
View Source
const ( DefaultMySQLDatastoreMigrationSource = "github://warrant-dev/warrant/migrations/datastore/mysql" DefaultPostgresDatastoreMigrationSource = "github://warrant-dev/warrant/migrations/datastore/postgres" DefaultSQLiteDatastoreMigrationSource = "github://warrant-dev/warrant/migrations/datastore/sqlite" DefaultAuthenticationUserIdClaim = "sub" PrefixWarrant = "warrant" ConfigFileName = "warrant.yaml" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthConfig ¶ added in v0.7.0
type AuthConfig struct {
ApiKey string `mapstructure:"apiKey"`
Provider *AuthProviderConfig `mapstructure:"providers"`
}
type AuthProviderConfig ¶ added in v0.13.0
type CheckConfig ¶ added in v0.31.0
type Config ¶
type Config interface {
GetPort() int
GetLogLevel() int8
GetEnableAccessLog() bool
GetAutoMigrate() bool
GetDatastore() DatastoreConfig
}
type DatastoreConfig ¶
type DatastoreConfig interface {
GetMySQL() *MySQLConfig
GetPostgres() *PostgresConfig
GetSQLite() *SQLiteConfig
}
type MySQLConfig ¶
type MySQLConfig struct {
Username string `mapstructure:"username"`
Password string `mapstructure:"password"`
Hostname string `mapstructure:"hostname"`
Database string `mapstructure:"database"`
MigrationSource string `mapstructure:"migrationSource"`
MaxIdleConnections int `mapstructure:"maxIdleConnections"`
ConnMaxIdleTime time.Duration `mapstructure:"connMaxIdleTime"`
MaxOpenConnections int `mapstructure:"maxOpenConnections"`
ConnMaxLifetime time.Duration `mapstructure:"connMaxLifetime"`
ReaderHostname string `mapstructure:"readerHostname"`
ReaderMaxIdleConnections int `mapstructure:"readerMaxIdleConnections"`
ReaderMaxOpenConnections int `mapstructure:"readerMaxOpenConnections"`
DSN string `mapstructure:"dsn"`
ReaderDSN string `mapstructure:"readerDsn"`
}
type PostgresConfig ¶ added in v0.4.0
type PostgresConfig struct {
Username string `mapstructure:"username"`
Password string `mapstructure:"password"`
Hostname string `mapstructure:"hostname"`
Database string `mapstructure:"database"`
SSLMode string `mapstructure:"sslmode"`
MigrationSource string `mapstructure:"migrationSource"`
MaxIdleConnections int `mapstructure:"maxIdleConnections"`
ConnMaxIdleTime time.Duration `mapstructure:"connMaxIdleTime"`
MaxOpenConnections int `mapstructure:"maxOpenConnections"`
ConnMaxLifetime time.Duration `mapstructure:"connMaxLifetime"`
ReaderHostname string `mapstructure:"readerHostname"`
ReaderMaxIdleConnections int `mapstructure:"readerMaxIdleConnections"`
ReaderMaxOpenConnections int `mapstructure:"readerMaxOpenConnections"`
DSN string `mapstructure:"dsn"`
ReaderDSN string `mapstructure:"readerDsn"`
}
type SQLiteConfig ¶ added in v0.11.0
type SQLiteConfig struct {
Database string `mapstructure:"database"`
InMemory bool `mapstructure:"inMemory"`
MigrationSource string `mapstructure:"migrationSource"`
MaxIdleConnections int `mapstructure:"maxIdleConnections"`
ConnMaxIdleTime time.Duration `mapstructure:"connMaxIdleTime"`
MaxOpenConnections int `mapstructure:"maxOpenConnections"`
ConnMaxLifetime time.Duration `mapstructure:"connMaxLifetime"`
}
type WarrantConfig ¶ added in v0.13.0
type WarrantConfig struct {
Port int `mapstructure:"port"`
LogLevel int8 `mapstructure:"logLevel"`
EnableAccessLog bool `mapstructure:"enableAccessLog"`
AutoMigrate bool `mapstructure:"autoMigrate"`
Datastore *WarrantDatastoreConfig `mapstructure:"datastore"`
Authentication *AuthConfig `mapstructure:"authentication"`
Check *CheckConfig `mapstructure:"check"`
}
func NewConfig ¶
func NewConfig() WarrantConfig
func (WarrantConfig) GetAuthentication ¶ added in v0.13.0
func (warrantConfig WarrantConfig) GetAuthentication() *AuthConfig
func (WarrantConfig) GetAutoMigrate ¶ added in v0.13.0
func (warrantConfig WarrantConfig) GetAutoMigrate() bool
func (WarrantConfig) GetCheck ¶ added in v0.31.0
func (warrantConfig WarrantConfig) GetCheck() *CheckConfig
func (WarrantConfig) GetDatastore ¶ added in v0.13.0
func (warrantConfig WarrantConfig) GetDatastore() DatastoreConfig
func (WarrantConfig) GetEnableAccessLog ¶ added in v0.13.0
func (warrantConfig WarrantConfig) GetEnableAccessLog() bool
func (WarrantConfig) GetLogLevel ¶ added in v0.13.0
func (warrantConfig WarrantConfig) GetLogLevel() int8
func (WarrantConfig) GetPort ¶ added in v0.13.0
func (warrantConfig WarrantConfig) GetPort() int
type WarrantDatastoreConfig ¶ added in v1.14.0
type WarrantDatastoreConfig struct {
MySQL *MySQLConfig `mapstructure:"mysql"`
Postgres *PostgresConfig `mapstructure:"postgres"`
SQLite *SQLiteConfig `mapstructure:"sqlite"`
}
func (WarrantDatastoreConfig) GetMySQL ¶ added in v1.14.0
func (warrantDatastoreConfig WarrantDatastoreConfig) GetMySQL() *MySQLConfig
func (WarrantDatastoreConfig) GetPostgres ¶ added in v1.14.0
func (warrantDatastoreConfig WarrantDatastoreConfig) GetPostgres() *PostgresConfig
func (WarrantDatastoreConfig) GetSQLite ¶ added in v1.14.0
func (warrantDatastoreConfig WarrantDatastoreConfig) GetSQLite() *SQLiteConfig
Click to show internal directories.
Click to hide internal directories.