Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ version: "2"
linters:
default: all
disable:
- lll
- exhaustruct
- wrapcheck
- wsl
Expand Down Expand Up @@ -53,7 +54,9 @@ formatters:
- goimports
- golines
# Formatters settings.
settings: {}
settings:
golines:
reformat-tags: false
exclusions:
# Mode of the generated files analysis.
#
Expand Down
4 changes: 2 additions & 2 deletions any.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (

// EnvAny represents either arbitrary value or an environment reference.
type EnvAny struct {
Value any `json:"value,omitempty" jsonschema:"anyof_required=value" mapstructure:"value" yaml:"value,omitempty"`
Variable *string `json:"env,omitempty" jsonschema:"anyof_required=env" mapstructure:"env" yaml:"env,omitempty"`
Value any `json:"value,omitempty" jsonschema:"anyof_required=value,description=Default literal value if the env is empty" mapstructure:"value" yaml:"value,omitempty"`
Variable *string `json:"env,omitempty" jsonschema:"anyof_required=env,description=Environment variable to be evaluated" mapstructure:"env" yaml:"env,omitempty"`
}

// NewEnvAny creates an EnvAny instance.
Expand Down
16 changes: 8 additions & 8 deletions environment.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ type GetEnvFunc func(string) (string, error)

// EnvString represents either a literal string or an environment reference.
type EnvString struct {
Value *string `json:"value,omitempty" jsonschema:"anyof_required=value" mapstructure:"value" yaml:"value,omitempty"`
Variable *string `json:"env,omitempty" jsonschema:"anyof_required=env" mapstructure:"env" yaml:"env,omitempty"`
Value *string `json:"value,omitempty" jsonschema:"anyof_required=value,description=Default literal value if the env is empty" mapstructure:"value" yaml:"value,omitempty"`
Variable *string `json:"env,omitempty" jsonschema:"anyof_required=env,description=Environment variable to be evaluated" mapstructure:"env" yaml:"env,omitempty"`
}

// NewEnvString creates an EnvString instance.
Expand Down Expand Up @@ -119,8 +119,8 @@ func (ev EnvString) GetCustom(getFunc GetEnvFunc) (string, error) {

// EnvInt represents either a literal integer or an environment reference.
type EnvInt struct {
Value *int64 `json:"value,omitempty" jsonschema:"anyof_required=value" mapstructure:"value" yaml:"value,omitempty"`
Variable *string `json:"env,omitempty" jsonschema:"anyof_required=env" mapstructure:"env" yaml:"env,omitempty"`
Value *int64 `json:"value,omitempty" jsonschema:"anyof_required=value,description=Default literal value if the env is empty" mapstructure:"value" yaml:"value,omitempty"`
Variable *string `json:"env,omitempty" jsonschema:"anyof_required=env,description=Environment variable to be evaluated" mapstructure:"env" yaml:"env,omitempty"`
}

// NewEnvInt creates an EnvInt instance.
Expand Down Expand Up @@ -223,8 +223,8 @@ func (ev EnvInt) GetCustom(getFunc GetEnvFunc) (int64, error) {

// EnvBool represents either a literal boolean or an environment reference.
type EnvBool struct {
Value *bool `json:"value,omitempty" jsonschema:"anyof_required=value" mapstructure:"value" yaml:"value,omitempty"`
Variable *string `json:"env,omitempty" jsonschema:"anyof_required=env" mapstructure:"env" yaml:"env,omitempty"`
Value *bool `json:"value,omitempty" jsonschema:"anyof_required=value,description=Default literal value if the env is empty" mapstructure:"value" yaml:"value,omitempty"`
Variable *string `json:"env,omitempty" jsonschema:"anyof_required=env,description=Environment variable to be evaluated" mapstructure:"env" yaml:"env,omitempty"`
}

// NewEnvBool creates an EnvBool instance.
Expand Down Expand Up @@ -327,8 +327,8 @@ func (ev EnvBool) GetCustom(getFunc GetEnvFunc) (bool, error) {

// EnvFloat represents either a literal floating point number or an environment reference.
type EnvFloat struct {
Value *float64 `json:"value,omitempty" jsonschema:"anyof_required=value" mapstructure:"value" yaml:"value,omitempty"`
Variable *string `json:"env,omitempty" jsonschema:"anyof_required=env" mapstructure:"env" yaml:"env,omitempty"`
Value *float64 `json:"value,omitempty" jsonschema:"anyof_required=value,description=Default literal value if the env is empty" mapstructure:"value" yaml:"value,omitempty"`
Variable *string `json:"env,omitempty" jsonschema:"anyof_required=env,description=Environment variable to be evaluated" mapstructure:"env" yaml:"env,omitempty"`
}

// NewEnvFloat creates an EnvFloat instance.
Expand Down
16 changes: 8 additions & 8 deletions map.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (

// EnvMapString represents either a literal string map or an environment reference.
type EnvMapString struct {
Value map[string]string `json:"value,omitempty" jsonschema:"anyof_required=value" mapstructure:"value" yaml:"value,omitempty"`
Variable *string `json:"env,omitempty" jsonschema:"anyof_required=env" mapstructure:"env" yaml:"env,omitempty"`
Value map[string]string `json:"value,omitempty" jsonschema:"anyof_required=value,description=Default literal value if the env is empty" mapstructure:"value" yaml:"value,omitempty"`
Variable *string `json:"env,omitempty" jsonschema:"anyof_required=env,description=Environment variable to be evaluated" mapstructure:"env" yaml:"env,omitempty"`
}

// NewEnvMapString creates an EnvMapString instance.
Expand Down Expand Up @@ -81,8 +81,8 @@ func (ev EnvMapString) GetCustom(getFunc GetEnvFunc) (map[string]string, error)

// EnvMapInt represents either a literal int map or an environment reference.
type EnvMapInt struct {
Value map[string]int64 `json:"value,omitempty" jsonschema:"anyof_required=value" mapstructure:"value" yaml:"value,omitempty"`
Variable *string `json:"env,omitempty" jsonschema:"anyof_required=env" mapstructure:"env" yaml:"env,omitempty"`
Value map[string]int64 `json:"value,omitempty" jsonschema:"anyof_required=value,description=Default literal value if the env is empty" mapstructure:"value" yaml:"value,omitempty"`
Variable *string `json:"env,omitempty" jsonschema:"anyof_required=env,description=Environment variable to be evaluated" mapstructure:"env" yaml:"env,omitempty"`
}

// NewEnvMapInt creates an EnvMapInt instance.
Expand Down Expand Up @@ -155,8 +155,8 @@ func (ev EnvMapInt) GetCustom(getFunc GetEnvFunc) (map[string]int64, error) {

// EnvMapFloat represents either a literal float map or an environment reference.
type EnvMapFloat struct {
Value map[string]float64 `json:"value,omitempty" jsonschema:"anyof_required=value" mapstructure:"value" yaml:"value,omitempty"`
Variable *string `json:"env,omitempty" jsonschema:"anyof_required=env" mapstructure:"env" yaml:"env,omitempty"`
Value map[string]float64 `json:"value,omitempty" jsonschema:"anyof_required=value,description=Default literal value if the env is empty" mapstructure:"value" yaml:"value,omitempty"`
Variable *string `json:"env,omitempty" jsonschema:"anyof_required=env,description=Environment variable to be evaluated" mapstructure:"env" yaml:"env,omitempty"`
}

// NewEnvMapFloat creates an EnvMapFloat instance.
Expand Down Expand Up @@ -229,8 +229,8 @@ func (ev EnvMapFloat) GetCustom(getFunc GetEnvFunc) (map[string]float64, error)

// EnvMapBool represents either a literal bool map or an environment reference.
type EnvMapBool struct {
Value map[string]bool `json:"value,omitempty" jsonschema:"anyof_required=value" mapstructure:"value" yaml:"value,omitempty"`
Variable *string `json:"env,omitempty" jsonschema:"anyof_required=env" mapstructure:"env" yaml:"env,omitempty"`
Value map[string]bool `json:"value,omitempty" jsonschema:"anyof_required=value,description=Default literal value if the env is empty" mapstructure:"value" yaml:"value,omitempty"`
Variable *string `json:"env,omitempty" jsonschema:"anyof_required=env,description=Environment variable to be evaluated" mapstructure:"env" yaml:"env,omitempty"`
}

// NewEnvMapBool creates an EnvMapBool instance.
Expand Down
16 changes: 8 additions & 8 deletions slice.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (

// EnvStringSlice represents either a literal string slice or an environment reference.
type EnvStringSlice struct {
Value []string `json:"value,omitempty" jsonschema:"anyof_required=value" mapstructure:"value" yaml:"value,omitempty"`
Variable *string `json:"env,omitempty" jsonschema:"anyof_required=env" mapstructure:"env" yaml:"env,omitempty"`
Value []string `json:"value,omitempty" jsonschema:"anyof_required=value,description=Default literal value if the env is empty" mapstructure:"value" yaml:"value,omitempty"`
Variable *string `json:"env,omitempty" jsonschema:"anyof_required=env,description=Environment variable to be evaluated" mapstructure:"env" yaml:"env,omitempty"`
}

// NewEnvStringSlice creates an EnvStringSlice instance.
Expand Down Expand Up @@ -105,8 +105,8 @@ func (ev EnvStringSlice) GetCustom(getFunc GetEnvFunc) ([]string, error) {

// EnvIntSlice represents either a literal integer slice or an environment reference.
type EnvIntSlice struct {
Value []int64 `json:"value,omitempty" jsonschema:"anyof_required=value" mapstructure:"value" yaml:"value,omitempty"`
Variable *string `json:"env,omitempty" jsonschema:"anyof_required=env" mapstructure:"env" yaml:"env,omitempty"`
Value []int64 `json:"value,omitempty" jsonschema:"anyof_required=value,description=Default literal value if the env is empty" mapstructure:"value" yaml:"value,omitempty"`
Variable *string `json:"env,omitempty" jsonschema:"anyof_required=env,description=Environment variable to be evaluated" mapstructure:"env" yaml:"env,omitempty"`
}

// NewEnvIntSlice creates an EnvIntSlice instance.
Expand Down Expand Up @@ -208,8 +208,8 @@ func (ev EnvIntSlice) GetCustom(getFunc GetEnvFunc) ([]int64, error) {

// EnvFloatSlice represents either a literal floating-point number slice or an environment reference.
type EnvFloatSlice struct {
Value []float64 `json:"value,omitempty" jsonschema:"anyof_required=value" mapstructure:"value" yaml:"value,omitempty"`
Variable *string `json:"env,omitempty" jsonschema:"anyof_required=env" mapstructure:"env" yaml:"env,omitempty"`
Value []float64 `json:"value,omitempty" jsonschema:"anyof_required=value,description=Default literal value if the env is empty" mapstructure:"value" yaml:"value,omitempty"`
Variable *string `json:"env,omitempty" jsonschema:"anyof_required=env,description=Environment variable to be evaluated" mapstructure:"env" yaml:"env,omitempty"`
}

// NewEnvFloatSlice creates an EnvFloatSlice instance.
Expand Down Expand Up @@ -311,8 +311,8 @@ func (ev EnvFloatSlice) GetCustom(getFunc GetEnvFunc) ([]float64, error) {

// EnvBoolSlice represents either a literal boolean slice or an environment reference.
type EnvBoolSlice struct {
Value []bool `json:"value,omitempty" jsonschema:"anyof_required=value" mapstructure:"value" yaml:"value,omitempty"`
Variable *string `json:"env,omitempty" jsonschema:"anyof_required=env" mapstructure:"env" yaml:"env,omitempty"`
Value []bool `json:"value,omitempty" jsonschema:"anyof_required=value,description=Default literal value if the env is empty" mapstructure:"value" yaml:"value,omitempty"`
Variable *string `json:"env,omitempty" jsonschema:"anyof_required=env,description=Environment variable to be evaluated" mapstructure:"env" yaml:"env,omitempty"`
}

// NewEnvBoolSlice creates an EnvBoolSlice instance.
Expand Down
Loading