generated from origadmin/.github
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(config): add enable flags for app components and services
Introduce boolean 'Enable' fields for various components and services within the application configuration. This allows for finer-grained control over the application's modules and services, enabling or disabling them as needed. BREAKING CHANGE: The configuration structure has been extended with 'Enable' flags. Users will need to update their configuration files to include these new fields for each component and service.
- Loading branch information
Showing
7 changed files
with
68 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,4 +4,5 @@ | |
package config | ||
|
||
type App struct { | ||
Enable bool | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,4 +4,5 @@ | |
package config | ||
|
||
type Backend struct { | ||
Enable bool | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
// Copyright (c) 2024 OrigAdmin. All rights reserved. | ||
|
||
// Package config is the config package for origen | ||
package config_test | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/origadmin/toolkits/codec" | ||
|
||
"github.com/origadmin/origen/config" | ||
) | ||
|
||
func TestC(t *testing.T) { | ||
config := config.Config{ | ||
Application: "Origen", | ||
PackageName: "origen", | ||
Author: "OrigAdmin", | ||
WirePath: "wire", | ||
SwaggerPath: "swag", | ||
Fontend: config.Fontend{ | ||
Enable: false, | ||
}, | ||
Backend: config.Backend{ | ||
Enable: true, | ||
}, | ||
Database: config.Database{ | ||
Enable: false, | ||
}, | ||
Extension: config.Extension{ | ||
Enable: false, | ||
}, | ||
Services: map[string]config.Service{ | ||
"user": { | ||
Enable: true, | ||
}, | ||
}, | ||
Description: "Origen is a CLI scaffolding for quickly setting up a project.", | ||
Version: "v0.0.0", | ||
} | ||
|
||
err := codec.EncodeTOMLFile("config.toml", config) | ||
if err != nil { | ||
t.Fatal(err) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,4 +4,5 @@ | |
package config | ||
|
||
type Extension struct { | ||
Enable bool | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,4 +4,5 @@ | |
package config | ||
|
||
type Fontend struct { | ||
Enable bool | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package config | ||
|
||
type Service struct { | ||
Enable bool | ||
} |