config

package
v0.0.0-...-8df91d0 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Configuration

type Configuration struct {
	Port        int
	Endpoint    string
	AdminSecret string
	SentryDsn   string
	SentryEnv   string
}

func NewConfigurationFromEnv

func NewConfigurationFromEnv() *Configuration

NewConfigurationFromEnv creates a new configuration instance and fetches values only from environment variables

func NewConfigurationWithCmdParams

func NewConfigurationWithCmdParams(cmd *cobra.Command) (*Configuration, error)

NewConfigurationWithCmdParams creates a new configuration instance and fetches values from both flags and environment variables

func (*Configuration) LoadConfigurationFromEnv

func (cfg *Configuration) LoadConfigurationFromEnv()

LoadConfigurationFromEnv fetches configuration from environment variables, prioritizing flags if set during invocation

func (*Configuration) LoadFlagsAndBind

func (cfg *Configuration) LoadFlagsAndBind(cmd *cobra.Command) error

LoadFlagsAndBind binds command line flags to Viper environment variables

Jump to

Keyboard shortcuts

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