eia-api-go/cmd/eia-client/internal/util/util.go

29 lines
580 B
Go
Raw Normal View History

2024-11-16 19:02:46 +00:00
package util
// These constants contain typed values
// for safely setting and retrieving flags
// from the cobra command
const (
FLAG_APIKEY = "apiKey"
ENV_API = "EIA_API_KEY"
FLAG_TMOUT = "timeout"
ENV_TMOUT = "EIA_API_TMOUT"
FLAG_API_LOG_LEVEL = "apiLogLevel"
ENV_API_LOG_LEVEL = "EIA_API_LOG_LEVEL"
FLAG_LOG_LEVEL = "logLevel"
ENV_LOG_LEVEL = "LOG_LEVEL"
)
// Type for context data
type eiaCtxField uint8
// These constants contain fields to safely set
// or get fields from the command context
const (
CTX_EIA_CLIENT eiaCtxField = iota
CTX_EIA_TMOUT
)