api

package
v0.0.0-...-536613a Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2016 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// VersionV1 is current api version
	VersionV1 = "v1"

	// Bearer is bearer header authentication
	Bearer = "Bearer"
	// TokenNameOfHeader token name of authentication header
	TokenNameOfHeader = "X-Get3W-Access-Token"
	// TokenNameOfQuery token name of authentication query
	TokenNameOfQuery = "access_token"

	// ErrFormat message
	ErrFormat = "Input format incorrect"
	// ErrUsernameExist message
	ErrUsernameExist = "Sorry. A user with that username already exists, or the username was invalid."
	// ErrEmailExist message
	ErrEmailExist = "Sorry. A user with that email address already exists, or the email was invalid."
	// ErrAppnameExist message
	ErrAppnameExist = "Sorry. An app with that name already exists."
	// ErrAppnameNotValid message
	ErrAppnameNotValid = "Sorry. An app with that name was invalid."
	// ErrPassword message
	ErrPassword = "Password is incorrect"
	// ErrPasswordLength message
	ErrPasswordLength = "Password is too short (minimum is 6 characters)."
	// ErrEmailNotExist message
	ErrEmailNotExist = "There is no user with that email address."

	// StaticProxyContent returns proxy.html content
	StaticProxyContent = `` /* 337-byte string literal not displayed */

	// StaticXDomainContent returns xdomain.min.js content
	StaticXDomainContent = `` /* 13227-byte string literal not displayed */
)

Variables

This section is empty.

Functions

func Config

func Config(c echo.Context) *home.Config

Config returns home.Config

func Error

func Error(c echo.Context, status int, err error) error

Error response default error by status code

func ErrorBadRequest

func ErrorBadRequest(c echo.Context, err error) error

ErrorBadRequest response bad request specified error message

func ErrorInternal

func ErrorInternal(c echo.Context, err error) error

ErrorInternal response internal server error with err information

func ErrorNotFound

func ErrorNotFound(c echo.Context, err error) error

ErrorNotFound response not found error with err information

func ErrorUnauthorized

func ErrorUnauthorized(c echo.Context, err error) error

ErrorUnauthorized response unauthorized error with err information

func GetApp

func GetApp(path string) (*get3w.App, error)

GetApp returns app by path

func IsAnonymous

func IsAnonymous(c echo.Context) bool

IsAnonymous return true if no authentication information in the header

func LoadRequestInput

func LoadRequestInput(c echo.Context, v interface{}) error

LoadRequestInput decode request body and add value to request

func Owner

func Owner(c echo.Context) string

Owner get owner by authentication

func StaticProxy

func StaticProxy() echo.HandlerFunc

StaticProxy response proxy.html content

func StaticXDomain

func StaticXDomain() echo.HandlerFunc

StaticXDomain response xdomain.min.js content

func StoreHeaders

func StoreHeaders(options ...*StoreHeaderOptions) echo.MiddlewareFunc

StoreHeaders get header values and set to context

func Version

func Version(c echo.Context) string

Version return accept version from reuqest header

Types

type StoreHeaderOptions

type StoreHeaderOptions struct {
}

StoreHeaderOptions s

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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