conf

package
v0.0.0-...-eccc266 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AuthProviderLocal = "local"
	AuthProviderAuth0 = "auth0"
	AuthProviderMock  = "mock"
)

Variables

This section is empty.

Functions

func InitConfig

func InitConfig(cfgFilePath string) error

InitConfig reads in config file and ENV variables if set. Should be called once at app startup.

Types

type Auth0

type Auth0 struct {
	Provider     string `yaml:"provider"`
	Domain       string `yaml:"domain"`
	ClientID     string `yaml:"client_id"`
	ClientSecret string `yaml:"client_secret"`
	Audience     string `yaml:"audience"`
	ConnectionID string `yaml:"connection_id"`
}

type Config

type Config struct {
	DatabaseDSN string  `yaml:"database_dsn"`
	HostName    string  `yaml:"host_name"`
	Graph       GraphQL `yaml:"graphql"`
	Auth        Auth0   `yaml:"auth"`
	Logging     Logging `yaml:"logging"`
}

func New

func New() *Config

func NewTestConfig

func NewTestConfig() *Config

NewTestConfig returns configuration suitable for testing.

func (*Config) Validate

func (c *Config) Validate() error

type GraphQL

type GraphQL struct {
	Port             string `yaml:"port"`
	EnablePlayground bool   `yaml:"enable_playground"`
}

type Logging

type Logging struct {
	Level  string `json:"level"`
	Format string `json:"format"`
}

Jump to

Keyboard shortcuts

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