utils

package
v0.0.0-...-1cbd5f8 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func OptionsReply

func OptionsReply(w http.ResponseWriter, r *http.Request)

Types

type AuthJSONReply

type AuthJSONReply func(*s.User, *http.Request) (interface{}, error)

type JSONReply

type JSONReply func(*http.Request) (interface{}, error)

func APIEndpoint

func APIEndpoint(fn api.SimpleEndpoint) JSONReply

func AuthAPIEndpoint

func AuthAPIEndpoint(fn api.AuthEndpoint) JSONReply

func RequireAuth

func RequireAuth(fn AuthJSONReply) JSONReply

func TxnID

func TxnID(fn JSONReply) JSONReply

JSONReply wrapper that checks for a `txnId` URL component. If that exists and the request is a PUT request the value is checked agains the previous txnID sent by this particular user (as identified by the token sent.

func (JSONReply) ServeHTTP

func (fn JSONReply) ServeHTTP(w http.ResponseWriter, r *http.Request)

Jump to

Keyboard shortcuts

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