Skip to content

Commit 47d1868

Browse files
committed
update README.md
1 parent 34d1c1c commit 47d1868

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

README.md

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,19 @@
1-
# Go Config [![Build Status](https://github.com/xgfone/gconf/actions/workflows/go.yml/badge.svg)](https://github.com/xgfone/gconf/actions/workflows/go.yml) [![GoDoc](https://pkg.go.dev/badge/github.com/xgfone/gconf)](https://pkg.go.dev/github.com/xgfone/gconf/v6) [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg?style=flat-square)](https://raw.githubusercontent.com/xgfone/gconf/master/LICENSE)
1+
# Go Config
22

3-
An extensible and powerful go configuration manager supporting `Go1.21+`, which is inspired by [oslo.config](https://github.com/openstack/oslo.config), [viper](https://github.com/spf13/viper) and [github.com/micro/go-micro/config](https://github.com/micro/go-micro/tree/master/config).
3+
[![Build Status](https://github.com/xgfone/gconf/actions/workflows/go.yml/badge.svg)](https://github.com/xgfone/gconf/actions/workflows/go.yml)
4+
[![GoDoc](https://pkg.go.dev/badge/github.com/xgfone/gconf)](https://pkg.go.dev/github.com/xgfone/gconf/v6)
5+
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg?style=flat-square)](https://raw.githubusercontent.com/xgfone/gconf/master/LICENSE)
6+
![Minimum Go Version](https://img.shields.io/github/go-mod/go-version/xgfone/gconf?label=Go%2B)
7+
![Latest SemVer](https://img.shields.io/github/v/tag/xgfone/gconf?sort=semver)
48

9+
An extensible and powerful go configuration manager, which is inspired by [oslo.config](https://github.com/openstack/oslo.config), [viper](https://github.com/spf13/viper) and [github.com/micro/go-micro/config](https://github.com/micro/go-micro/tree/master/config).
510

611
## Install
12+
713
```shell
814
$ go get -u github.com/xgfone/gconf/v6
915
```
1016

11-
1217
## Features
1318

1419
- A atomic key-value configuration center.
@@ -17,7 +22,6 @@ $ go get -u github.com/xgfone/gconf/v6
1722
- Support to change of the configuration option thread-safely during running.
1823
- Support to observe the change of the configration options.
1924

20-
2125
## Basic
2226

2327
```go
@@ -93,7 +97,6 @@ func main() {
9397
}
9498
```
9599

96-
97100
## Option Proxy
98101

99102
```go
@@ -127,7 +130,6 @@ func main() {
127130
}
128131
```
129132

130-
131133
## Option Group
132134

133135
```go
@@ -221,14 +223,14 @@ func main() {
221223
}
222224
```
223225

224-
225226
## Data Decoder
227+
226228
The data decoder is a function like `func(src []byte, dst map[string]interface{}) error`, which is used to decode the configration data from the data source.
227229

228230
`Config` supports three kinds of decoders by default, such as `ini`, `json`, `yaml`, and `yml` is the alias of `yaml`. You can customize yourself decoder, then add it into `Config`, such as `Config.AddDecoder("type", NewCustomizedDecoder())`.
229231

230-
231232
## Data Source
233+
232234
A source is used to read the configuration from somewhere the data is. And it can also watch the change the data.
233235

234236
```go
@@ -319,7 +321,6 @@ func main() {
319321
}
320322
```
321323

322-
323324
## Snapshot & Backup
324325

325326
```go

0 commit comments

Comments
 (0)