api

package
v0.0.0-...-1be2e0f Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2016 License: BSD-3-Clause Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CONTENT_JSON = iota + 1
	CONTENT_HTML
)

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API struct {
	Angle        int     `json:"angle"`
	Mode         int     `json:"mode"`
	ModeString   string  `json:"mode-string,omitempty"`
	Modifier     int     `json:"modifier"`
	Speed        float64 `json:"speed"`
	Latitude     float64 `json:"latitude"`
	Longitude    float64 `json:"longitude"`
	Accelerating bool    `json:"accelerating"`
	Error        string  `json:"error,omitempty"`
}

type APIControllers

type APIControllers struct {
	Using       string   `json:"using,omitempty"`
	Controllers []string `json:"controllers,omitempty"`
}

type APICoordinates

type APICoordinates struct {
	Key          string                             `json:"key,omitempty"`
	Latitude     float64                            `json:"latitude,omitempty"`
	Longitude    float64                            `json:"longitude,omitempty"`
	Accelerating bool                               `json:"accelerating,omitempty"`
	Coordinates  map[string]*coordinates.Coordinate `json:"coordinates,omitempty"`
	Error        string                             `json:"error,omitempty"`
}

type APINews

type APINews struct {
	News        []*news.News `json:"news,omitempty"`
	LastSuccess time.Time    `json:"last-success,omitempty"`
}

type APIPlugin

type APIPlugin struct {
	Using       string    `json:"using,omitempty"`
	Every       string    `json:"every,omitempty"`
	SinceLast   string    `json:"since-last,omitempty"`
	LastSuccess time.Time `json:"last-success,omitempty"`
	Offline     bool      `json:"offline"`
	Running     bool      `json:"running"`
}

type APIPlugins

type APIPlugins struct {
	Using   string   `json:"using,omitempty"`
	Plugins []string `json:"plugins,omitempty"`
}

type APIVersion

type APIVersion struct {
	Version      string             `json:"version"`
	VersionState string             `json:"version-state"`
	Major        int                `json:"major"`
	Minor        int                `json:"minor"`
	Build        int                `json:"build"`
	Versions     []*version.Version `json:"versions,omitempty"`
	Running      bool               `json:"running"`
	Stopping     bool               `json:"stopping"`
	Once         bool               `json:"once"`
}

type Handlers

type Handlers struct {
	Pattern string
	Handler http.HandlerFunc
}

type Server

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

func Create

func Create(
	server *http.Server,
	version *version.Client,
	news *news.Client,
	plugin *p.Plugin,
	plugins []string,
	controller *c.Controller,
	controllers []string,
) *Server

func (*Server) APIControllersRespond

func (self *Server) APIControllersRespond(
	api *APIControllers,
	w http.ResponseWriter,
	r *http.Request,
)

func (*Server) APICoordinatesRespond

func (self *Server) APICoordinatesRespond(
	api *APICoordinates,
	w http.ResponseWriter,
	r *http.Request,
	code int,
)

func (*Server) APINewsRespond

func (self *Server) APINewsRespond(
	api *APINews,
	w http.ResponseWriter,
	r *http.Request,
)

func (*Server) APIPluginRespond

func (self *Server) APIPluginRespond(
	api *APIPlugin,
	w http.ResponseWriter,
	r *http.Request,
)

func (*Server) APIPluginsRespond

func (self *Server) APIPluginsRespond(
	api *APIPlugins,
	w http.ResponseWriter,
	r *http.Request,
)

func (*Server) APIRespond

func (self *Server) APIRespond(
	api *API,
	w http.ResponseWriter,
	r *http.Request,
	code int,
)

func (*Server) APIVersionRespond

func (self *Server) APIVersionRespond(
	api *APIVersion,
	w http.ResponseWriter,
	r *http.Request,
)

func (*Server) Accelerate

func (self *Server) Accelerate(w http.ResponseWriter, r *http.Request)

func (*Server) AddCoordinates

func (self *Server) AddCoordinates(w http.ResponseWriter, r *http.Request)

func (*Server) Bicycle

func (self *Server) Bicycle(w http.ResponseWriter, r *http.Request)

func (*Server) Car

func (self *Server) Car(w http.ResponseWriter, r *http.Request)

func (*Server) Controller

func (self *Server) Controller(
	w http.ResponseWriter,
	r *http.Request,
)

func (*Server) Controllers

func (self *Server) Controllers(w http.ResponseWriter, r *http.Request)

func (*Server) Coordinates

func (self *Server) Coordinates(w http.ResponseWriter, r *http.Request)

func (*Server) Decelerate

func (self *Server) Decelerate(w http.ResponseWriter, r *http.Request)

func (*Server) DecreaseModifier

func (self *Server) DecreaseModifier(w http.ResponseWriter, r *http.Request)

func (*Server) DeleteCoordinates

func (self *Server) DeleteCoordinates(w http.ResponseWriter, r *http.Request)

func (*Server) Flip

func (self *Server) Flip(w http.ResponseWriter, r *http.Request)

func (*Server) Get

func (self *Server) Get(w http.ResponseWriter, r *http.Request)

func (*Server) GetAPI

func (self *Server) GetAPI() *API

func (*Server) GetAPIControllers

func (self *Server) GetAPIControllers() *APIControllers

func (*Server) GetAPICoordinates

func (self *Server) GetAPICoordinates() *APICoordinates

func (*Server) GetAPINews

func (self *Server) GetAPINews() *APINews

func (*Server) GetAPIPlugin

func (self *Server) GetAPIPlugin() *APIPlugin

func (*Server) GetAPIPlugins

func (self *Server) GetAPIPlugins() *APIPlugins

func (*Server) GetAPIVersion

func (self *Server) GetAPIVersion() *APIVersion

func (*Server) GetHandlers

func (self *Server) GetHandlers() []*Handlers

func (*Server) Headers

func (self *Server) Headers(
	w http.ResponseWriter,
	content int,
	code int,
)

func (*Server) IncreaseModifier

func (self *Server) IncreaseModifier(w http.ResponseWriter, r *http.Request)

func (*Server) Index

func (self *Server) Index(w http.ResponseWriter, r *http.Request)

func (*Server) Jog

func (self *Server) Jog(w http.ResponseWriter, r *http.Request)

func (*Server) Left

func (self *Server) Left(w http.ResponseWriter, r *http.Request)

func (*Server) ListenAndServe

func (self *Server) ListenAndServe() error

func (*Server) ListenAndServeTLS

func (self *Server) ListenAndServeTLS(certFile, keyFile string) error

func (*Server) News

func (self *Server) News(w http.ResponseWriter, r *http.Request)

func (*Server) NorthEast

func (self *Server) NorthEast(w http.ResponseWriter, r *http.Request)

func (*Server) NorthWest

func (self *Server) NorthWest(w http.ResponseWriter, r *http.Request)

func (*Server) Plugin

func (self *Server) Plugin(w http.ResponseWriter, r *http.Request)

func (*Server) Plugins

func (self *Server) Plugins(w http.ResponseWriter, r *http.Request)

func (*Server) ResetModifier

func (self *Server) ResetModifier(w http.ResponseWriter, r *http.Request)

func (*Server) Right

func (self *Server) Right(w http.ResponseWriter, r *http.Request)

func (*Server) ServerAddr

func (self *Server) ServerAddr() string

func (*Server) Set

func (self *Server) Set(w http.ResponseWriter, r *http.Request)

func (*Server) SetAngle

func (self *Server) SetAngle(w http.ResponseWriter, r *http.Request)

func (*Server) SetCoordinates

func (self *Server) SetCoordinates(w http.ResponseWriter, r *http.Request)

func (*Server) SetCoords

func (self *Server) SetCoords(w http.ResponseWriter, r *http.Request)

func (*Server) SetModifier

func (self *Server) SetModifier(w http.ResponseWriter, r *http.Request)

func (*Server) SouthEast

func (self *Server) SouthEast(w http.ResponseWriter, r *http.Request)

func (*Server) SouthWest

func (self *Server) SouthWest(w http.ResponseWriter, r *http.Request)

func (*Server) ToggleMode

func (self *Server) ToggleMode(w http.ResponseWriter, r *http.Request)

func (*Server) Version

func (self *Server) Version(w http.ResponseWriter, r *http.Request)

func (*Server) VersionOnce

func (self *Server) VersionOnce(w http.ResponseWriter, r *http.Request)

func (*Server) VersionStart

func (self *Server) VersionStart(w http.ResponseWriter, r *http.Request)

func (*Server) VersionStop

func (self *Server) VersionStop(w http.ResponseWriter, r *http.Request)

func (*Server) Walk

func (self *Server) Walk(w http.ResponseWriter, r *http.Request)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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