Documentation
¶
Index ¶
Constants ¶
View Source
const MaxRequestSize = 100
MaxRequestSize is the maximum request size supported by the api
Variables ¶
This section is empty.
Functions ¶
func Count ¶
func Count(conn *connection.MWSConnection, query *query.MWSQuery) (count int64, err error)
Count counts MathWebSearch Query results
Types ¶
type MWSAPIRequest ¶
type MWSAPIRequest struct { *query.MWSQuery Count bool `json:"count,omitempty"` From int64 `json:"from,omitempty"` Size int64 `json:"size,omitempty"` Complete bool `json:"complete,omitempty"` }
MWSAPIRequest is a request sent to mws via the REST API
func (*MWSAPIRequest) Validate ¶
func (req *MWSAPIRequest) Validate() error
Validate validates an MWSAPI Request
type MWSHandler ¶
MWSHandler represents an http server capable of answering queries to mws
func (*MWSHandler) Connect ¶
func (handler *MWSHandler) Connect() (err error)
Connect connects this handler
func (*MWSHandler) Enabled ¶
func (handler *MWSHandler) Enabled() bool
Enabled checks if the MWSDaemon is enabled
func (*MWSHandler) Name ¶
func (handler *MWSHandler) Name() string
Name returns the name of this daemon
func (*MWSHandler) ServeHTTP ¶
func (handler *MWSHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) (code int, res interface{}, err error)
ServeHTTP implements handling of a request
Click to show internal directories.
Click to hide internal directories.