mirror of
https://github.com/imjasonh/appengine-value
synced 2026-07-06 22:12:22 +00:00
spacing
This commit is contained in:
parent
bd93c5f186
commit
589432686a
1 changed files with 7 additions and 7 deletions
14
README.md
14
README.md
|
|
@ -9,8 +9,8 @@ Your app requires secret values (OAuth secrets, API keys, passwords) and you rig
|
|||
|
||||
```
|
||||
const (
|
||||
clientID = "123456.clientaccount.foo"
|
||||
clientSecret = "s8p3rs3cr1t"
|
||||
clientID = "123456.clientaccount.foo"
|
||||
clientSecret = "s8p3rs3cr1t"
|
||||
)
|
||||
```
|
||||
|
||||
|
|
@ -22,17 +22,17 @@ Solution
|
|||
import value "github.com/ImJasonH/appengine-value"
|
||||
|
||||
func doOAuth(c appengine.Context) {
|
||||
clientID := value.Get(c, "client_id")
|
||||
clientSecret := value.Get(c, "client_secret")
|
||||
// use clientID and clientSecret
|
||||
clientID := value.Get(c, "client_id")
|
||||
clientSecret := value.Get(c, "client_secret")
|
||||
// use clientID and clientSecret
|
||||
}
|
||||
```
|
||||
|
||||
If you have multiple values, you can **batch lookups**:
|
||||
```
|
||||
func doOAuth(c appengine.Context) {
|
||||
vals := value.GetMulti(c, "client_id", "client_secret")
|
||||
clientID, clientSecret := vals["client_id"], vals["client_secret"]
|
||||
vals := value.GetMulti(c, "client_id", "client_secret")
|
||||
clientID, clientSecret := vals["client_id"], vals["client_secret"]
|
||||
}
|
||||
```
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue