config

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

README

Configuration

You will need to perform a 1-time action of creating a .config.yaml file based on the .example files. The Taskfiles will also source a .dotenv files which match the naming conventions called for {{.ENV}} to ease the overriding of environment variables. These files are intentionally added to the .gitignore within this repository to prevent you from accidentally committing secrets or other sensitive information which may live inside the server's environment variables.

All settings in the yaml configuration can also be overwritten with environment variables prefixed with RIVERBOAT_.

Configuration precedence is as follows, the latter overriding the former:

  1. default values set in the config struct within the code
  2. .config.yaml values
  3. Environment variables

Regenerating

If you've made changes to the code in this code base (specifically interfaces referenced in the config.go) and want to regenerate the configuration, run task config:generate

Documentation

Overview

Package config holds configuration stuff to configure the things

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultConfigFilePath = "./config/.config.yaml"
)

Functions

This section is empty.

Types

type Config

type Config struct {
	// RefreshInterval determines how often to reload the config
	RefreshInterval time.Duration `json:"refreshInterval" koanf:"refreshInterval" default:"10m"`
	// River is the configuration for the job queue
	River river.Config `koanf:"river" json:"river"`
}

Config contains the configuration for the server

func Load

func Load(cfgFile *string) (*Config, error)

Load is responsible for loading the configuration from a YAML file and environment variables. If the `cfgFile` is empty or nil, it sets the default configuration file path. Config settings are taken from default values, then from the config file, and finally from environment the later overwriting the former.

Jump to

Keyboard shortcuts

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