server

package
v0.0.0-...-3912389 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2016 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInternalServerError = errors.New("Something unexpected happened on the server")
View Source
var Version = "0.1.11"

Version of IronFunctions

Functions

func ToEnvName

func ToEnvName(envtype, name string) string

Types

type Handle

type Handle func(http.ResponseWriter, *http.Request, Params)

type Param

type Param struct {
	Key   string
	Value string
}

type Params

type Params []Param

type Server

type Server struct {
	Runner          *runner.Runner
	Router          *gin.Engine
	Datastore       models.Datastore
	MQ              models.MessageQueue
	AppListeners    []ifaces.AppListener
	SpecialHandlers []ifaces.SpecialHandler
}
var Api *Server

Would be nice to not have this is a global, but hard to pass things around to the handlers in Gin without it.

func (*Server) AddAppListener

func (s *Server) AddAppListener(listener ifaces.AppListener)

AddAppListener adds a listener that will be notified on App changes.

func (*Server) AddSpecialHandler

func (s *Server) AddSpecialHandler(handler ifaces.SpecialHandler)

func (*Server) FireAfterAppUpdate

func (s *Server) FireAfterAppUpdate(ctx context.Context, app *models.App) error

func (*Server) FireBeforeAppUpdate

func (s *Server) FireBeforeAppUpdate(ctx context.Context, app *models.App) error

func (*Server) Run

func (s *Server) Run(ctx context.Context)

func (*Server) UseSpecialHandlers

func (s *Server) UseSpecialHandlers(ginC *gin.Context) error

type SpecialHandlerContext

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

func (*SpecialHandlerContext) Datastore

func (c *SpecialHandlerContext) Datastore() models.Datastore

func (*SpecialHandlerContext) Get

func (c *SpecialHandlerContext) Get(key string) (value interface{}, exists bool)

func (*SpecialHandlerContext) Request

func (c *SpecialHandlerContext) Request() *http.Request

func (*SpecialHandlerContext) Set

func (c *SpecialHandlerContext) Set(key string, value interface{})

Jump to

Keyboard shortcuts

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