rest

package
v0.0.0-...-831f302 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2015 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewRESTServer

func NewRESTServer(cfg *config.Config) http.Handler

NewRESTServer creates an http.Handler to handle HTTP requests.

func NewServer

func NewServer(cfg *config.Config) *http.Server

NewServer creates a new RESTful server for gog agent. It will also starts the agent server.

Types

type RESTServer

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

RESTServer handles RESTful requests for gog agent.

func (*RESTServer) Broadcast

func (rh *RESTServer) Broadcast(w http.ResponseWriter, r *http.Request)

Broadcast broadcasts the message to the cluster

func (*RESTServer) Config

func (rh *RESTServer) Config(w http.ResponseWriter, r *http.Request)

Config get/set the current configuration.

func (*RESTServer) Join

func (rh *RESTServer) Join(w http.ResponseWriter, r *http.Request)

Join joins the agent to a cluster.

func (*RESTServer) Leave

func (rh *RESTServer) Leave(w http.ResponseWriter, r *http.Request)

Leave makes the agent to exit.

func (*RESTServer) List

func (rh *RESTServer) List(w http.ResponseWriter, r *http.Request)

List lists the views.

func (*RESTServer) RegisterAPI

func (rh *RESTServer) RegisterAPI(mux *http.ServeMux)

registerAPI registers the api urls.

func (*RESTServer) ServeHTTP

func (rh *RESTServer) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP implements the http.Handler for RESTServer. It will get the handler from mux and invoke the handler.

func (*RESTServer) UserMessagHandler

func (rh *RESTServer) UserMessagHandler(msg []byte)

UserMessagHandler is the handler for user messages. It will run a script specified by the configuration.

Jump to

Keyboard shortcuts

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