config

package
v0.0.0-...-d9433bb Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PreloadEnvironment

func PreloadEnvironment()

Types

type Config

type Config struct {
	Server      Server
	LogLevel    string // LogLevel - add an enum for a few levels, to ensure stability.
	DatabaseURL string
	RedisURL    string
	APIPort     string
	APIVer      string
	APIBase     string
	AdminEmail  string
	HMACSecKey  []byte

	PrivKeyPEM []byte
	PubKeyPEM  []byte
	// contains filtered or unexported fields
}

func ReadConfig

func ReadConfig() (config Config, err error)

type EmailConfig

type EmailConfig struct {
	Host     string
	Port     uint
	Username string
	Password string
}

type Server

type Server struct {
	RunMode      Stage
	HTTPPort     string
	ReadTimeout  time.Duration
	WriteTimeout time.Duration
	AppName      string
}

type Stage

type Stage string
const (
	StageProduction  Stage = "PRODUCTION"
	StageStaging     Stage = "STAGING"
	StageIntegration Stage = "INT"
	StageTesting     Stage = "DEVELOP"
)

func CurrentStage

func CurrentStage() Stage

func (Stage) Is

func (s Stage) Is(stage string) bool

Jump to

Keyboard shortcuts

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