server

package
v0.0.0-...-fad388b Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2016 License: MIT Imports: 29 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UserIdFieldName      = "UserId__"
	AdminUserIdFieldName = "AdminUserId__"
	ResIdFieldName       = "ResourceId__"
	ContentFieldName     = "Content__"
	RequestFieldName     = "Request__"
	ConfVerFieldName     = "ConfVer__"
)

Variables

This section is empty.

Functions

func GetUserFromToken

func GetUserFromToken(r *http.Request) appgo.Id

Types

type DefaultSchema

type DefaultSchema struct {
}

func NewDefaultSchema

func NewDefaultSchema() *DefaultSchema

func (*DefaultSchema) KeysGen

func (s *DefaultSchema) KeysGen(r *http.Request) map[string]string

type HandlerType

type HandlerType int
const (
	HandlerTypeJson HandlerType
	HandlerTypeHtml
)

type Metrics

type Metrics struct {
	// contains filtered or unexported fields
}

func (*Metrics) ServeHTTP

func (m *Metrics) ServeHTTP(rw http.ResponseWriter, r *http.Request, next http.HandlerFunc)

type MetricsSchema

type MetricsSchema interface {
	KeysGen(r *http.Request) map[string]string
}

type Server

type Server struct {
	*mux.Router
	// contains filtered or unexported fields
}

func NewServer

func NewServer(ts TokenStore, middlewares []negroni.Handler,
	mschema []MetricsSchema) *Server

func (*Server) AddAppleAppSiteAsso

func (s *Server) AddAppleAppSiteAsso(content []byte)

func (*Server) AddHtml

func (s *Server) AddHtml(path, layout string, htmls []interface{}, funcs template.FuncMap)

func (*Server) AddProxy

func (s *Server) AddProxy(path string, handler http.Handler)

func (*Server) AddRest

func (s *Server) AddRest(path string, rests []interface{})

func (*Server) AddStatic

func (s *Server) AddStatic(path, fileDir string)

func (*Server) Serve

func (s *Server) Serve()

type TokenStore

type TokenStore interface {
	Validate(token auth.Token) bool
}

Jump to

Keyboard shortcuts

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