mwsengine

package
v0.0.0-...-0e8dd81 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2019 License: GPL-3.0 Imports: 11 Imported by: 0

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

func Run

func Run(conn *connection.MWSConnection, query *query.MWSQuery, from int64, size int64) (res *result.Result, err error)

Run runs an MWS Query

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

type MWSHandler struct {
	Host string
	Port int
	// contains filtered or unexported fields
}

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

Jump to

Keyboard shortcuts

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