Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrParse = errors.New("failed to parse environment variables")
var ErrParseWithPrefix = errors.New("failed to parse environment variables for the given prefix")
Functions ¶
func IsCommunity ¶ added in v0.12.5
func IsCommunity() bool
func IsDevelopment ¶ added in v0.14.0
func IsDevelopment() bool
func IsEnterprise ¶
func IsEnterprise() bool
func IsEnterpriseOrCloud ¶
func IsEnterpriseOrCloud() bool
func Parse ¶ added in v0.13.3
Parse parses the environment variables.
This function uses the envconfig package as its default backend, so it requires the struct to be annotated with the envconfig tags. Check the envconfig documentation for more information.
The T generic parameter must be a struct with the fields annotated with the envconfig tags, that will be returned with the values parsed from the environment variables.
func ParseWithPrefix ¶ added in v0.13.0
ParseWithPrefix parses the environment variables for the a given prefix.
This function uses the envconfig package as its default backend, so it requires the struct to be annotated with the envconfig tags. Check the envconfig documentation for more information.
The T generic parameter must be a struct with the fields annotated with the envconfig tags, that will be returned with the values parsed from the environment variables.
Types ¶
type Backend ¶
Backend is an interface for any sort of underlying key/value store.
var DefaultBackend Backend
DefaultBackend define the backend to be used to get environment variables.
type Edition ¶
type Edition string
func CurrentEdition ¶
func CurrentEdition() Edition
CurrentEdition returns the resolved edition, panicking on an unrecognized value so a misconfigured instance fails rather than silently running as community. Entrypoints should call ResolveEdition at startup to surface the error cleanly; this panic is a last-resort invariant for the predicates below.
func ResolveEdition ¶
ResolveEdition reads SHELLHUB_EDITION, normalizes it (trim + lowercase) and defaults to Community when empty. It returns an error for any unrecognized value so entrypoints can validate the edition once at startup and fail fast with a clean message instead of relying on CurrentEdition's lazy panic.