libldbrest

package
v0.0.0-...-0c6421a Latest Latest
Warning

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

Go to latest
Published: May 13, 2015 License: BSD-3-Clause Imports: 11 Imported by: 0

Documentation

Overview

libldbrest contains all the logic implementing the REST server described in http://godoc.org/github.com/teepark/ldbrest.

Index

Constants

View Source
const (
	ABSMAX = 1000
)

Variables

This section is empty.

Functions

func CleanupDB

func CleanupDB()

CleanupDB frees the global vars associated with the open leveldb.

func InitRouter

func InitRouter(prefix string) *httprouter.Router

InitRouter creates an *httprouter.Router and sets the endpoints to run the ldbrest server

func OpenDB

func OpenDB(dbpath string)

OpenDB intializes global vars for the leveldb database. Be sure and call CleanupDB() to free those resources.

Types

type SwappableHandler

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

An atomic.Value that deals specifically with http.Handlers, and which can act as an http.Handler itself by grabbing and running the currently held Handler.

func (*SwappableHandler) Load

func (sh *SwappableHandler) Load() http.Handler

func (*SwappableHandler) ServeHTTP

func (sh *SwappableHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

func (*SwappableHandler) Store

func (sh *SwappableHandler) Store(handler http.Handler)

Jump to

Keyboard shortcuts

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