Skip to content
This repository has been archived by the owner on Dec 7, 2020. It is now read-only.

Commit

Permalink
CLI Relfection
Browse files Browse the repository at this point in the history
- forgot to add the parsing of Duration and unit64 types (capturing the time.Duration really)
  • Loading branch information
gambol99 committed Jan 9, 2017
1 parent 260d2c8 commit 0f59394
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@
#### **2.0.2**

FEATURES:
* adding the --enable-cors-global to switch on CORs header injects into every response
* adding the --enable-cors-global to switch on CORs header injects into every response [#PR174](https://github.com/gambol99/keycloak-proxy/pull/174)

BUGS:
* Fixed the time.Duration flags in the reflection code [#PR173](https://github.com/gambol99/keycloak-proxy/pull/173)
* Fixed the environment variable type [#PR176](https://github.com/gambol99/keycloak-proxy/pull/176)

#### **2.0.1**

Expand Down
8 changes: 8 additions & 0 deletions cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,9 +172,17 @@ func parseCLIOptions(cx *cli.Context, config *Config) (err error) {
for _, x := range cx.StringSlice(name) {
reflect.Append(reflect.ValueOf(config).Elem().FieldByName(field.Name), reflect.ValueOf(x))
}
case reflect.Int64:
switch field.Type.String() {
case "time.Duration":
reflect.ValueOf(config).Elem().FieldByName(field.Name).SetInt(int64(cx.Duration(name)))
default:
reflect.ValueOf(config).Elem().FieldByName(field.Name).SetInt(cx.Int64(name))
}
}
}
}
fmt.Printf("cors %s", config.CorsMaxAge.String())
if cx.IsSet("tag") {
tags, err := decodeKeyPairs(cx.StringSlice("tag"))
if err != nil {
Expand Down

0 comments on commit 0f59394

Please sign in to comment.