Skip to content

Commit

Permalink
refactor: simple annotation support
Browse files Browse the repository at this point in the history
  • Loading branch information
hui.wang committed Jan 7, 2022
1 parent eea6063 commit 9b88991
Show file tree
Hide file tree
Showing 8 changed files with 105 additions and 103 deletions.
40 changes: 20 additions & 20 deletions gen_options_optiongen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions kv/gen_options_optiongen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 16 additions & 16 deletions tests/gen_config_optiongen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 9 additions & 8 deletions tests/replit/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,14 @@ func ConfigOptionDeclareWithDefault() interface{} {
"TypeSliceFloat64": []float64{1.64, 2.64, 3.64, 4.64},
"TypeSliceDuratuon": []time.Duration([]time.Duration{time.Second, time.Minute, time.Hour}),

"TypeMapStringInt": map[string]int{"a": 1, "b": 2},
"TypeMapIntString": map[int]string{1: "a", 2: "b"},
"TypeMapStringString": map[string]string{"a": "a", "b": "b"},
"TypeMapIntInt": map[int]int{1: 1, 2: 2},
"TypeMapStringDuration": map[string]time.Duration(map[string]time.Duration{"read": time.Second, "write": time.Second * 5}),
"Redis@getter#RedisVisitor": (*Redis)(NewRedis()),
"ETCD@getter#ETCDVisitor": (*ETCD)(NewETCD()),
"TestInterface": (interface{})(nil),
"TypeMapStringInt": map[string]int{"a": 1, "b": 2},
"TypeMapIntString": map[int]string{1: "a", 2: "b"},
"TypeMapStringString": map[string]string{"a": "a", "b": "b"},
"TypeMapIntInt": map[int]int{1: 1, 2: 2},
"TypeMapStringDuration": map[string]time.Duration(map[string]time.Duration{"read": time.Second, "write": time.Second * 5}),
// annotation@Redis(getter="RedisVisitor")
"Redis": (*Redis)(NewRedis()),
"ETCD": (*ETCD)(NewETCD()),
"TestInterface": (interface{})(nil),
}
}
85 changes: 43 additions & 42 deletions tests/replit/config/gen_config_optiongen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions tests/replit/config/gen_etcd_optiongen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 9b88991

Please sign in to comment.