config

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2023 License: BSD-3-Clause Imports: 7 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 {
	Maintenance  bool                `split_words:"true" default:"false"`
	BindAddr     string              `split_words:"true" default:":8000"`
	Mode         string              `split_words:"true" default:"release"`
	LogLevel     logger.LevelDecoder `split_words:"true" default:"info"`
	ConsoleLog   bool                `split_words:"true" default:"false"`
	AllowOrigins []string            `split_words:"true" default:"https://epistolary.app"`
	Database     DatabaseConfig
	Token        TokenConfig
	Sentry       sentry.Config
	// contains filtered or unexported fields
}

func New

func New() (conf Config, err error)

New creates a new Config object from environment variables prefixed with EPISTOLARY.

func (Config) GetLogLevel

func (c Config) GetLogLevel() zerolog.Level

func (Config) IsZero

func (c Config) IsZero() bool

func (Config) Mark

func (c Config) Mark() (Config, error)

Mark a manually constructed as processed as long as it is validated.

func (Config) Validate

func (c Config) Validate() (err error)

Validate the config to make sure that it is usable to run the Epistolary server.

type DatabaseConfig

type DatabaseConfig struct {
	URL      string `split_words:"true" required:"true"`
	ReadOnly bool   `split_words:"true" default:"false"`
	Testing  bool   `split_words:"true" default:"false"`
}

type TokenConfig

type TokenConfig struct {
	Keys     map[string]string `required:"false"`
	Audience string            `default:"https://epistolary.app"`
	Issuer   string            `default:"https://api.epistolary.app"`
}

Jump to

Keyboard shortcuts

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