Documentation
¶
Index ¶
- Variables
- func BindLegacyEnv(w io.Writer)
- func EnumCheck(cmd *cobra.Command, flag string, allowed []string)
- func IntPtrOrNil(i int) *int
- func JSONValue(raw, flag string) any
- func MigrateLegacyConfig(home string, w io.Writer) (configPath string, migrated bool)
- func StringArrayToIntArray(strArr []string) []int
- func StringPtrOrNil(s string) *string
- func StringToDate(dateStr string) openapi_types.Date
- func StringToEmail(email string) openapi_types.Email
- func StringToInt(s string) int
- func StringToTime(dateStr string) time.Time
- type Version
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func BindLegacyEnv ¶
BindLegacyEnv binds config keys to their HOSTINGER_MAIL_* env var with a deprecated HAPI_* fallback on the global viper, emitting a one-time notice to w per key whose value comes from the legacy variable.
func IntPtrOrNil ¶
func MigrateLegacyConfig ¶
MigrateLegacyConfig returns the YAML config path the CLI should read and whether a one-time migration (or legacy fallback) happened. When the new ~/.hostinger-mail.yaml is absent but a legacy ~/.hapi.yaml exists, it moves the old file to the new path. If the move fails, it falls back to the old path in place. Notices are written to w. With no legacy file, it is a no-op.
func StringArrayToIntArray ¶
func StringPtrOrNil ¶
func StringToDate ¶ added in v1.1.2
func StringToDate(dateStr string) openapi_types.Date
func StringToEmail ¶ added in v1.1.2
func StringToEmail(email string) openapi_types.Email
StringToEmail keeps format:email query params converting through utils like every other formatted kind, so generated commands need no extra import.