Skip to content

HTTP and WebSocket endpoints for veldt applications

License

Notifications You must be signed in to change notification settings

zeroviscosity/veldt-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

78 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

veldt-api

Godoc Build Status Go Report Card

Dependencies

Requires the Go programming language binaries with the GOPATH environment variable specified and $GOPATH/bin in your PATH.

Installation

go get github.com/unchartedsoftware/veldt-api

Development

NOTE: Requires Go version 1.11+.

Clone the repository outside of your $GOPATH:

git clone [email protected]:unchartedsoftware/veldt-api.git
cd veldt-api

Install dependencies

make install

Usage

This package provides HTTP and WebSocket handlers to connect the on-demand tile-based analytics of veldt to HTTP and WebSocket endpoints.

Example

package main

import (
	"github.com/zenazn/goji"
	"github.com/unchartedsoftware/veldt-api/http"
	"github.com/unchartedsoftware/veldt-api/middleware"
	"github.com/unchartedsoftware/veldt-api/ws"
)

func main() {

	// Mount logger middleware
	goji.Use(middleware.Log)
	// Mount gzip middleware
	goji.Use(middleware.Gzip)

	// Meta websocket handler
	log.Infof("Meta WebSocket route: '%s'", ws.MetaRoute)
	goji.Get(ws.MetaRoute, ws.MetaHandler)

	// Tile websocket handler
	log.Infof("Tile WebSocket route: '%s'", ws.TileRoute)
	goji.Get(ws.TileRoute, ws.TileHandler)

	// Meta request handler
	log.Infof("Meta HTTP route: '%s'", http.MetaRoute)
	goji.Post(http.MetaRoute, http.MetaHandler)
	// Tile request handler
	log.Infof("Tile HTTP route: '%s'", http.TileRoute)
	goji.Post(http.TileRoute, http.TileHandler)

	// Start the server
	goji.Serve()
}

About

HTTP and WebSocket endpoints for veldt applications

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •