mirror of
https://github.com/kevin-DL/m3o-go.git
synced 2026-01-19 13:35:25 +00:00
Commit from m3o/m3o action
This commit is contained in:
33
examples/answer/README.md
Executable file
33
examples/answer/README.md
Executable file
@@ -0,0 +1,33 @@
|
||||
# Answer
|
||||
|
||||
An [m3o.com](https://m3o.com) API. For example usage see [m3o.com/Answer/api](https://m3o.com/Answer/api).
|
||||
|
||||
Endpoints:
|
||||
|
||||
## Question
|
||||
|
||||
Ask a question and receive an instant answer
|
||||
|
||||
|
||||
[https://m3o.com/answer/api#Question](https://m3o.com/answer/api#Question)
|
||||
|
||||
```go
|
||||
package example
|
||||
|
||||
import(
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/go.m3o.com/answer"
|
||||
)
|
||||
|
||||
// Ask a question and receive an instant answer
|
||||
func AskAquestion() {
|
||||
answerService := answer.NewAnswerService(os.Getenv("M3O_API_TOKEN"))
|
||||
rsp, err := answerService.Question(&answer.QuestionRequest{
|
||||
Query: "microsoft",
|
||||
|
||||
})
|
||||
fmt.Println(rsp, err)
|
||||
}
|
||||
```
|
||||
17
examples/answer/question/askAQuestion.go
Executable file
17
examples/answer/question/askAQuestion.go
Executable file
@@ -0,0 +1,17 @@
|
||||
package example
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/go.m3o.com/answer"
|
||||
)
|
||||
|
||||
// Ask a question and receive an instant answer
|
||||
func AskAquestion() {
|
||||
answerService := answer.NewAnswerService(os.Getenv("M3O_API_TOKEN"))
|
||||
rsp, err := answerService.Question(&answer.QuestionRequest{
|
||||
Query: "microsoft",
|
||||
})
|
||||
fmt.Println(rsp, err)
|
||||
}
|
||||
Reference in New Issue
Block a user