client

package
v1.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 18, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	Debug bool

	Project  *ProjectService
	Corpus   *CorpusService
	Response *ResponseService
	// contains filtered or unexported fields
}

func NewClient

func NewClient(host string, port int) *Client

func (*Client) Do

func (client *Client) Do(r *http.Request, v interface{}) (*Response, error)

func (*Client) NewRequest

func (client *Client) NewRequest(method, urlStr string, body interface{}) (*http.Request, error)

func (*Client) ParseUrl

func (client *Client) ParseUrl(uri string) *url.URL

func (*Client) SetDebug

func (client *Client) SetDebug(debug bool)

type Corpus

type Corpus struct {
	bot.Corpus
	Score float32 `json:"score"`
}

type CorpusService

type CorpusService service

type Message

type Message struct {
	Code    string `json:"code"`
	Message string `json:"message"`
	Error   string `json:"error"`
	Url     string `json:"url"`
}

type ProjectService

type ProjectService service

func (ProjectService) AddProject

func (project ProjectService) AddProject(name, config string) (*bot.Project, error)

func (ProjectService) GetProjectList

func (project ProjectService) GetProjectList() ([]*bot.Project, error)

type Response

type Response struct {
	*http.Response
	// contains filtered or unexported fields
}

type ResponseService

type ResponseService service

func (*ResponseService) GetResponse

func (response *ResponseService) GetResponse(project, query, context string) (responses *Responses, err error)

type Responses

type Responses struct {
	Question string    `json:"question"`
	Results  []*Corpus `json:"results"`
	Message  string    `json:"message"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL