Skip to content

feat(fxconfig): Added app description support #272

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 26, 2024
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
2 changes: 1 addition & 1 deletion fxconfig/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/ankorstore/yokai/fxconfig
go 1.20

require (
github.com/ankorstore/yokai/config v1.3.0
github.com/ankorstore/yokai/config v1.4.0
github.com/stretchr/testify v1.9.0
go.uber.org/fx v1.21.0
)
Expand Down
4 changes: 2 additions & 2 deletions fxconfig/go.sum
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
github.com/ankorstore/yokai/config v1.3.0 h1:si2h4mESPN5pj14CBMT/VGFgFn0voKEVylr8hQeIgEk=
github.com/ankorstore/yokai/config v1.3.0/go.mod h1:OV2QiL2dyNLCxhcGO+GcSa8Wm20+00H03VBHm9SPVuE=
github.com/ankorstore/yokai/config v1.4.0 h1:O3ZuTGud388Gq55bQwrfs/vdjYSZZvj0VUL6yZp4rcg=
github.com/ankorstore/yokai/config v1.4.0/go.mod h1:OV2QiL2dyNLCxhcGO+GcSa8Wm20+00H03VBHm9SPVuE=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=
Expand Down
3 changes: 3 additions & 0 deletions fxconfig/module_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ func TestModule(t *testing.T) {
).RequireStart().RequireStop()

assert.Equal(t, "default-app", cfg.AppName())
assert.Equal(t, "default-description", cfg.AppDescription())
assert.Equal(t, config.AppEnvDev, cfg.AppEnv())
assert.True(t, cfg.IsDevEnv())
assert.False(t, cfg.IsTestEnv())
Expand Down Expand Up @@ -52,6 +53,7 @@ func TestModuleWithTestEnv(t *testing.T) {
).RequireStart().RequireStop()

assert.Equal(t, "test-app", cfg.AppName())
assert.Equal(t, "test-description", cfg.AppDescription())
assert.Equal(t, config.AppEnvTest, cfg.AppEnv())
assert.False(t, cfg.IsDevEnv())
assert.True(t, cfg.IsTestEnv())
Expand Down Expand Up @@ -80,6 +82,7 @@ func TestModuleWithCustomEnv(t *testing.T) {
).RequireStart().RequireStop()

assert.Equal(t, "custom-app", cfg.AppName())
assert.Equal(t, "custom-description", cfg.AppDescription())
assert.Equal(t, "custom", cfg.AppEnv())
assert.False(t, cfg.IsDevEnv())
assert.False(t, cfg.IsTestEnv())
Expand Down
1 change: 1 addition & 0 deletions fxconfig/testdata/config/config.custom.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
app:
name: custom-app
description: custom-description
env: custom
debug: true
config:
Expand Down
1 change: 1 addition & 0 deletions fxconfig/testdata/config/config.test.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
app:
name: test-app
description: test-description
env: test
debug: true
config:
Expand Down
1 change: 1 addition & 0 deletions fxconfig/testdata/config/config.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
app:
name: default-app
description: default-description
env: dev
version: 0.1.0
debug: false
Expand Down
Loading