Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetDurationFromViper ¶
GetDurationFromViper safely extracts a duration from viper, handling both duration strings and integer seconds.
func SetupViper ¶
func SetupViper(configName string, configPaths []string, defaults map[string]interface{}) (*viper.Viper, error)
SetupViper creates and configures a new Viper instance for loading test configuration. configName: name of the config file (e.g., ".env") configPaths: paths to search for the config file defaults: default values to set
func ValidateRequiredFields ¶
ValidateRequiredFields checks that all required configuration values are set. Takes a map of environment variable names to their values. Returns an Error if any required fields are missing.
Types ¶
type BaseConfig ¶
type BaseConfig struct {
BaseURL string
AuthToken string
RequestTimeout time.Duration
TestTimeout time.Duration
SkipIntegration bool
DebugLogging bool
LogRequests bool
LogResponses bool
}
BaseConfig contains the base configuration fields common across all API test clients. Services should embed this struct and add service-specific fields.
func NewBaseConfig ¶
func NewBaseConfig() *BaseConfig
NewBaseConfig creates a new BaseConfig with default values.