engine

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: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler interface {

	// Name returns the name of this handler and the appropriate path
	Name() string

	// Enabled checks if this handler is a no-op
	Enabled() bool

	// Connect connects this handler
	// which may be a no-op if no settings were provided
	Connect() (err error)

	// ServeHTTP handles a given request
	ServeHTTP(w http.ResponseWriter, r *http.Request) (code int, res interface{}, err error)
}

Handler is a handler using an engine

type Server

type Server struct {
	// contains filtered or unexported fields
}

Server is a server capable of answering requests to multiple engines

func NewServer

func NewServer() (server *Server)

NewServer makes a new server

func (*Server) AddHandler

func (server *Server) AddHandler(handler Handler)

AddHandler adds a handler to the server

func (*Server) ListenAndServe

func (server *Server) ListenAndServe(host string, port int) error

ListenAndServe starts serving requests on the given port

func (*Server) Status

func (server *Server) Status() *StatusResponse

Status returns the current status

type StatusResponse

type StatusResponse struct {
	// Name of this server
	Name string `json:"name"`
	// Server tagline
	TagLine string `json:"tagline"`

	// List of engines that are enabled on this server.
	Engines map[string]bool `json:"engines"`
}

StatusResponse is the response for a status request

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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