-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add new driver use Java properties as config source
- Loading branch information
Showing
3 changed files
with
29 additions
and
0 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
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,26 @@ | ||
/* | ||
Package properties is a driver use Java properties format content as config source | ||
Usage please see readme. | ||
*/ | ||
package properties | ||
|
||
import ( | ||
"github.com/gookit/config/v2" | ||
"github.com/gookit/properties" | ||
) | ||
|
||
// DriverName string | ||
const DriverName = "properties" | ||
|
||
var ( | ||
// Decoder the properties content decoder | ||
Decoder config.Decoder = properties.Decode | ||
|
||
// Encoder the properties content encoder | ||
Encoder config.Encoder = properties.Encode | ||
|
||
// Driver for yaml | ||
Driver = config.NewDriver(DriverName, Decoder, Encoder) | ||
) |