mirror of
https://github.com/kevin-DL/m3o-go.git
synced 2026-01-11 10:34:27 +00:00
40 lines
701 B
Go
Executable File
40 lines
701 B
Go
Executable File
package search
|
|
|
|
import (
|
|
"go.m3o.com/client"
|
|
)
|
|
|
|
type Search interface {
|
|
Vote(*VoteRequest) (*VoteResponse, error)
|
|
}
|
|
|
|
func NewSearchService(token string) *SearchService {
|
|
return &SearchService{
|
|
client: client.NewClient(&client.Options{
|
|
Token: token,
|
|
}),
|
|
}
|
|
}
|
|
|
|
type SearchService struct {
|
|
client *client.Client
|
|
}
|
|
|
|
// Vote to have the Search api launched faster!
|
|
func (t *SearchService) Vote(request *VoteRequest) (*VoteResponse, error) {
|
|
|
|
rsp := &VoteResponse{}
|
|
return rsp, t.client.Call("search", "Vote", request, rsp)
|
|
|
|
}
|
|
|
|
type VoteRequest struct {
|
|
// optional message
|
|
Message string `json:"message"`
|
|
}
|
|
|
|
type VoteResponse struct {
|
|
// response message
|
|
Message string `json:"message"`
|
|
}
|