Skip to content

Commit

Permalink
Merge pull request #451 from essentialkaos/develop
Browse files Browse the repository at this point in the history
Version 12.111.1
  • Loading branch information
andyone authored Mar 26, 2024
2 parents 3ca60ec + daea4b1 commit a8dbdda
Show file tree
Hide file tree
Showing 5 changed files with 196 additions and 65 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
## Changelog

### 12.111.1

* `[knf/united]` United configuration separated from global KNF configuration

### 12.111.0

* `[knf/united]` Added helper method `AddOptions`
Expand Down
2 changes: 1 addition & 1 deletion ek.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
// ////////////////////////////////////////////////////////////////////////////////// //

// VERSION is current ek package version
const VERSION = "12.111.0"
const VERSION = "12.111.1"

// ////////////////////////////////////////////////////////////////////////////////// //

Expand Down
45 changes: 43 additions & 2 deletions knf/united/example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ import (
// ////////////////////////////////////////////////////////////////////////////////// //

func ExampleCombine() {
// Load global KNF config
err := knf.Global("/path/to/your/config.knf")
// Load KNF config
config, err := knf.Read("/path/to/your/config.knf")

if err != nil {
fmt.Printf("Error: %v\n", err)
Expand All @@ -43,6 +43,7 @@ func ExampleCombine() {

// Combine combine KNF configuration, options and environment variables
Combine(
config,
Mapping{"test:option-one", "O:option-one", "TEST_OPTION_ONE"},
Mapping{"test:option-two", "k:option-two", "TEST_OPTION_TWO"},
)
Expand All @@ -54,6 +55,7 @@ func ExampleCombine() {
)

Combine(
config,
// Create mapping manually
Mapping{optOne, ToOption(optOne), ToEnvVar(optOne)},
// Create simple mapping
Expand Down Expand Up @@ -139,7 +141,10 @@ func ExampleE() {
}

func ExampleGetS() {
config, _ := knf.Read("/path/to/your/config.knf")

Combine(
config,
Mapping{"test:option-one", "O:option-one", "TEST_OPTION_ONE"},
Mapping{"test:option-two", "k:option-two", "TEST_OPTION_TWO"},
)
Expand All @@ -148,7 +153,10 @@ func ExampleGetS() {
}

func ExampleGetB() {
config, _ := knf.Read("/path/to/your/config.knf")

Combine(
config,
Mapping{"test:option-one", "O:option-one", "TEST_OPTION_ONE"},
Mapping{"test:option-two", "k:option-two", "TEST_OPTION_TWO"},
)
Expand All @@ -157,7 +165,10 @@ func ExampleGetB() {
}

func ExampleGetI() {
config, _ := knf.Read("/path/to/your/config.knf")

Combine(
config,
Mapping{"test:option-one", "O:option-one", "TEST_OPTION_ONE"},
Mapping{"test:option-two", "k:option-two", "TEST_OPTION_TWO"},
)
Expand All @@ -166,7 +177,10 @@ func ExampleGetI() {
}

func ExampleGetI64() {
config, _ := knf.Read("/path/to/your/config.knf")

Combine(
config,
Mapping{"test:option-one", "O:option-one", "TEST_OPTION_ONE"},
Mapping{"test:option-two", "k:option-two", "TEST_OPTION_TWO"},
)
Expand All @@ -175,7 +189,10 @@ func ExampleGetI64() {
}

func ExampleGetU() {
config, _ := knf.Read("/path/to/your/config.knf")

Combine(
config,
Mapping{"test:option-one", "O:option-one", "TEST_OPTION_ONE"},
Mapping{"test:option-two", "k:option-two", "TEST_OPTION_TWO"},
)
Expand All @@ -184,7 +201,10 @@ func ExampleGetU() {
}

func ExampleGetU64() {
config, _ := knf.Read("/path/to/your/config.knf")

Combine(
config,
Mapping{"test:option-one", "O:option-one", "TEST_OPTION_ONE"},
Mapping{"test:option-two", "k:option-two", "TEST_OPTION_TWO"},
)
Expand All @@ -193,7 +213,10 @@ func ExampleGetU64() {
}

func ExampleGetF() {
config, _ := knf.Read("/path/to/your/config.knf")

Combine(
config,
Mapping{"test:option-one", "O:option-one", "TEST_OPTION_ONE"},
Mapping{"test:option-two", "k:option-two", "TEST_OPTION_TWO"},
)
Expand All @@ -202,7 +225,10 @@ func ExampleGetF() {
}

func ExampleGetM() {
config, _ := knf.Read("/path/to/your/config.knf")

Combine(
config,
Mapping{"test:option-one", "O:option-one", "TEST_OPTION_ONE"},
Mapping{"test:option-two", "k:option-two", "TEST_OPTION_TWO"},
)
Expand All @@ -211,7 +237,10 @@ func ExampleGetM() {
}

func ExampleGetD() {
config, _ := knf.Read("/path/to/your/config.knf")

Combine(
config,
Mapping{"test:option-one", "O:option-one", "TEST_OPTION_ONE"},
Mapping{"test:option-two", "k:option-two", "TEST_OPTION_TWO"},
)
Expand All @@ -220,7 +249,10 @@ func ExampleGetD() {
}

func ExampleGetTD() {
config, _ := knf.Read("/path/to/your/config.knf")

Combine(
config,
Mapping{"test:option-one", "O:option-one", "TEST_OPTION_ONE"},
Mapping{"test:option-two", "k:option-two", "TEST_OPTION_TWO"},
)
Expand All @@ -229,7 +261,10 @@ func ExampleGetTD() {
}

func ExampleGetTS() {
config, _ := knf.Read("/path/to/your/config.knf")

Combine(
config,
Mapping{"test:option-one", "O:option-one", "TEST_OPTION_ONE"},
Mapping{"test:option-two", "k:option-two", "TEST_OPTION_TWO"},
)
Expand All @@ -238,7 +273,10 @@ func ExampleGetTS() {
}

func ExampleGetTZ() {
config, _ := knf.Read("/path/to/your/config.knf")

Combine(
config,
Mapping{"test:option-one", "O:option-one", "TEST_OPTION_ONE"},
Mapping{"test:option-two", "k:option-two", "TEST_OPTION_TWO"},
)
Expand All @@ -247,7 +285,10 @@ func ExampleGetTZ() {
}

func ExampleGetL() {
config, _ := knf.Read("/path/to/your/config.knf")

Combine(
config,
Mapping{"test:option-one", "O:option-one", "TEST_OPTION_ONE"},
Mapping{"test:option-two", "k:option-two", "TEST_OPTION_TWO"},
)
Expand Down
Loading

0 comments on commit a8dbdda

Please sign in to comment.