config

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2023 License: BSD-3-Clause Imports: 8 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         GinMode             `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.

type DatabaseConfig

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

type GinMode added in v0.3.0

type GinMode string

func (GinMode) Validate added in v0.3.0

func (s GinMode) Validate() error

type TokenConfig

type TokenConfig struct {
	Keys         map[string]string `desc:"a map of key ID to key path"`
	Audience     string            `default:"https://epistolary.app"`
	Issuer       string            `default:"https://api.epistolary.app"`
	CookieDomain string            `split_words:"true" default:"epistolary.app"`
}

Jump to

Keyboard shortcuts

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