app

package
v0.0.0-...-e6cf3b3 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2015 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PublicBucketName = "PublicVars"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ApiHandler

type ApiHandler func(r *http.Request) (httpCode int, result interface{})

type App

type App struct {
	Conf
	DB     *bolt.DB
	Router *mux.Router
	Log    *logrus.Logger
}

func (*App) ApiCall

func (a *App) ApiCall(ah ApiHandler) http.HandlerFunc

func (*App) Close

func (a *App) Close()

func (*App) GetPublicParam

func (a *App) GetPublicParam(r *http.Request) (int, interface{})

func (*App) InitRouter

func (app *App) InitRouter()

func (*App) LoadConfig

func (a *App) LoadConfig(file string) error

func (*App) NotFound

func (a *App) NotFound(r *http.Request) (int, interface{})

func (*App) PostPublicParam

func (a *App) PostPublicParam(r *http.Request) (respCode int, respValue interface{})

type Conf

type Conf struct {
	Listen       string
	DBFile       string
	LogLevel     string
	CORSOrigins  []string
	Sites        map[string]*SiteInfo
	PublicParams map[string]*ParamProps
}

type H

type H map[string]interface{}

type ParamProps

type ParamProps struct {
	Default        interface{}
	MaxRequestSize int
	RawSchema      json.RawMessage      `json:"Schema"`
	Schema         *gojsonschema.Schema `json:-`
}

type SiteInfo

type SiteInfo struct {
	APIRoot string
}

Jump to

Keyboard shortcuts

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