api

package
v0.0.0-...-366a9e0 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2017 License: BSD-3-Clause Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CORS

func CORS(next http.HandlerFunc) http.HandlerFunc

CORS wraps a HandlerFunc to respond to OPTIONS requests properly

func Gzip

func Gzip(next http.HandlerFunc) http.HandlerFunc

Gzip wraps a HandlerFunc to compress responses when possible

func Record

func Record(next http.HandlerFunc) http.HandlerFunc

Record wraps a HandlerFunc to record API requests for analytical purposes

func Run

func Run()

Run adds Handlers to default http listener for API

Types

type Externalable

type Externalable interface {
	// Accept allows external content submissions of a specific type
	Accept(http.ResponseWriter, *http.Request) error
}

Externalable accepts or rejects external POST requests to endpoints such as: /api/content/external?type=Review

type Trustable

type Trustable interface {
	AutoApprove(http.ResponseWriter, *http.Request) error
}

Trustable allows external content to be auto-approved, meaning content sent as an Externalable will be stored in the public content bucket

Directories

Path Synopsis
Package analytics provides the methods to run an analytics reporting system for API requests which may be useful to users for measuring access and possibly identifying bad actors abusing requests.
Package analytics provides the methods to run an analytics reporting system for API requests which may be useful to users for measuring access and possibly identifying bad actors abusing requests.

Jump to

Keyboard shortcuts

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