update go samples

This commit is contained in:
William Cheng 2023-06-01 09:09:00 +08:00
parent 5fae4f5d93
commit 63a311a2e6
3 changed files with 78 additions and 0 deletions

View File

@ -210,6 +210,19 @@ r, err := client.Service.Operation(auth, args)
Note, each API key must be added to a map of `map[string]APIKey` where the key is: api_key and passed in as the auth context for each request.
Example
```golang
auth := context.WithValue(
context.Background(),
sw.ContextAPIKeys,
map[string]sw.APIKey{
"api_key": {Key: "API_KEY_STRING"},
},
)
r, err := client.Service.Operation(auth, args)
```
### api_key_query
- **Type**: API key
@ -218,6 +231,19 @@ Note, each API key must be added to a map of `map[string]APIKey` where the key i
Note, each API key must be added to a map of `map[string]APIKey` where the key is: api_key_query and passed in as the auth context for each request.
Example
```golang
auth := context.WithValue(
context.Background(),
sw.ContextAPIKeys,
map[string]sw.APIKey{
"api_key_query": {Key: "API_KEY_STRING"},
},
)
r, err := client.Service.Operation(auth, args)
```
### http_basic_test
- **Type**: HTTP basic authentication

View File

@ -99,6 +99,19 @@ Authentication schemes defined for the API:
Note, each API key must be added to a map of `map[string]APIKey` where the key is: X-Api-Key and passed in as the auth context for each request.
Example
```golang
auth := context.WithValue(
context.Background(),
sw.ContextAPIKeys,
map[string]sw.APIKey{
"X-Api-Key": {Key: "API_KEY_STRING"},
},
)
r, err := client.Service.Operation(auth, args)
```
### api_key_query
- **Type**: API key
@ -107,6 +120,19 @@ Note, each API key must be added to a map of `map[string]APIKey` where the key i
Note, each API key must be added to a map of `map[string]APIKey` where the key is: api_key and passed in as the auth context for each request.
Example
```golang
auth := context.WithValue(
context.Background(),
sw.ContextAPIKeys,
map[string]sw.APIKey{
"api_key": {Key: "API_KEY_STRING"},
},
)
r, err := client.Service.Operation(auth, args)
```
## Documentation for Utility Methods

View File

@ -230,6 +230,19 @@ r, err := client.Service.Operation(auth, args)
Note, each API key must be added to a map of `map[string]APIKey` where the key is: api_key and passed in as the auth context for each request.
Example
```golang
auth := context.WithValue(
context.Background(),
sw.ContextAPIKeys,
map[string]sw.APIKey{
"api_key": {Key: "API_KEY_STRING"},
},
)
r, err := client.Service.Operation(auth, args)
```
### api_key_query
- **Type**: API key
@ -238,6 +251,19 @@ Note, each API key must be added to a map of `map[string]APIKey` where the key i
Note, each API key must be added to a map of `map[string]APIKey` where the key is: api_key_query and passed in as the auth context for each request.
Example
```golang
auth := context.WithValue(
context.Background(),
sw.ContextAPIKeys,
map[string]sw.APIKey{
"api_key_query": {Key: "API_KEY_STRING"},
},
)
r, err := client.Service.Operation(auth, args)
```
### http_basic_test
- **Type**: HTTP basic authentication