universe

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EnvKeyUniverse = "UC_UNIVERSE"
)

Environment keys for config settings We use these instead of command line args because it works better with `go test`

Variables

This section is empty.

Functions

func ServiceName

func ServiceName() string

ServiceName returns the name of the currently-running service. TODO: this probably should live in service or something else, but that currently creates a cycle so here is fine (and it's not unrelated to universe)

Types

type Universe

type Universe string

Universe represents a universe (or environment) that UC code runs in

const (
	Undefined Universe = "undefined" // undefined universe
	Dev       Universe = "dev"       // local dev laptops
	Test      Universe = "test"      // automated tests on localhost
	CI        Universe = "ci"        // AWS continuous integration env
	Debug     Universe = "debug"     // AWS EB universe to debug off master
	Staging   Universe = "staging"   // cloud hosted staging universe (similar to prod)
	Prod      Universe = "prod"      // user-facing prod deployment
	Container Universe = "container" //  container (dev only for now)
)

Supported universes.

func AllUniverses

func AllUniverses() []Universe

AllUniverses returns a list of all known universes Useful for config testing etc

func Current

func Current() Universe

Current checks the current application environment.

func (Universe) IsCloud

func (u Universe) IsCloud() bool

IsCloud returns true if universe is one of the cloud envs (prod, staging debug)

func (Universe) IsContainer added in v1.1.0

func (u Universe) IsContainer() bool

IsContainer true if universe is container

func (Universe) IsDebug added in v1.1.0

func (u Universe) IsDebug() bool

IsDebug returns true if universe is debug

func (Universe) IsDev

func (u Universe) IsDev() bool

IsDev returns true if universe is dev

func (Universe) IsProd

func (u Universe) IsProd() bool

IsProd returns true if universe is prod

func (Universe) IsProdOrStaging

func (u Universe) IsProdOrStaging() bool

IsProdOrStaging returns true if universe is prod or staging

func (Universe) IsTestOrCI

func (u Universe) IsTestOrCI() bool

IsTestOrCI returns true if universe is CI or tests

func (Universe) IsUndefined added in v1.1.0

func (u Universe) IsUndefined() bool

IsUndefined returns true if universe is undefined

func (Universe) Validate

func (u Universe) Validate() error

Validate implements Validateable

Jump to

Keyboard shortcuts

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