Documentation
¶
Index ¶
- func NewRESTServer(cfg *config.Config) http.Handler
- func NewServer(cfg *config.Config) *http.Server
- type RESTServer
- func (rh *RESTServer) Broadcast(w http.ResponseWriter, r *http.Request)
- func (rh *RESTServer) Config(w http.ResponseWriter, r *http.Request)
- func (rh *RESTServer) Join(w http.ResponseWriter, r *http.Request)
- func (rh *RESTServer) Leave(w http.ResponseWriter, r *http.Request)
- func (rh *RESTServer) List(w http.ResponseWriter, r *http.Request)
- func (rh *RESTServer) RegisterAPI(mux *http.ServeMux)
- func (rh *RESTServer) ServeHTTP(w http.ResponseWriter, r *http.Request)
- func (rh *RESTServer) UserMessagHandler(msg []byte)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewRESTServer ¶
NewRESTServer creates an http.Handler to handle HTTP requests.
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.
Click to show internal directories.
Click to hide internal directories.