api

package
v0.0.0-...-acaa9d6 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2017 License: MIT Imports: 13 Imported by: 2

Documentation

Index

Constants

View Source
const (
	INVALID_REQUEST   = "Invalid Request"
	INVALID_SESSION   = "Session is expired or invalid"
	MISSING_PARAMETER = "Missing required parameter"
)

Variables

View Source
var (
	Srv                      *Server
	DefaultServerReadTimeout = 30 // in seconds
	DefaultServerTransport   = "tcp"
)

Functions

func GenerateSimpleMessage

func GenerateSimpleMessage(msg string, errorMsg string) string

func RequestServer

func RequestServer(host, transport string, port, timeout int, statics map[string]http.Handler, handlers map[string]func(http.ResponseWriter, *http.Request))

func Respond

func Respond(mediaType string, charset string, fn func(w http.ResponseWriter, r *http.Request) string) http.HandlerFunc

func SearchPersonPublicKeys

func SearchPersonPublicKeys(r *http.Request, db database.DBConnection) string

Respond to an ajax request: return all the public keys for this email, on behalf of the particular registered person, with a valid session

Types

type Server

type Server struct {
	Logger    *log.Logger
	Transport string
	// contains filtered or unexported fields
}

type SimpleMessage

type SimpleMessage struct {
	Ack string `json:"msg"`
	Err string `json:"err,omitempty"`
}

Jump to

Keyboard shortcuts

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