Documentation ¶
Index ¶
- Constants
- Variables
- func DefaultEnqueue(ctx context.Context, mq models.MessageQueue, task *models.Task) (*models.Task, error)
- func ToEnvName(envtype, name string) string
- type AppCreateListener
- type AppDeleteListener
- type AppUpdateListener
- type Handle
- type HandlerContext
- type Param
- type Params
- type RunnerListener
- type Server
- func (s *Server) AddAppCreateListener(listener AppCreateListener)
- func (s *Server) AddAppDeleteListener(listener AppDeleteListener)
- func (s *Server) AddAppUpdateListener(listener AppUpdateListener)
- func (s *Server) AddRunnerListener(listener RunnerListener)
- func (s *Server) AddSpecialHandler(handler SpecialHandler)
- func (s *Server) FireAfterAppCreate(ctx context.Context, app *models.App) error
- func (s *Server) FireAfterAppDelete(ctx context.Context, app *models.App) error
- func (s *Server) FireAfterAppUpdate(ctx context.Context, app *models.App) error
- func (s *Server) FireAfterDispatch(ctx context.Context, route *models.Route) error
- func (s *Server) FireBeforeAppCreate(ctx context.Context, app *models.App) error
- func (s *Server) FireBeforeAppDelete(ctx context.Context, app *models.App) error
- func (s *Server) FireBeforeAppUpdate(ctx context.Context, app *models.App) error
- func (s *Server) FireBeforeDispatch(ctx context.Context, route *models.Route) error
- func (s *Server) Start(ctx context.Context)
- func (s *Server) UseSpecialHandlers(ctx context.Context, req *http.Request, resp http.ResponseWriter) (context.Context, error)
- type ServerOption
- type SpecialHandler
- type SpecialHandlerContext
Constants ¶
View Source
const ( EnvLogLevel = "log_level" EnvMQURL = "mq_url" EnvDBURL = "db_url" EnvPort = "port" // be careful, Gin expects this variable to be "port" EnvAPIURL = "api_url" )
Variables ¶
View Source
var ErrInternalServerError = errors.New("Something unexpected happened on the server")
View Source
var ErrNoSpecialHandlerFound = errors.New("Path not found")
View Source
var Version = "0.2.4"
Version of IronFunctions
Functions ¶
func DefaultEnqueue ¶
Types ¶
type AppCreateListener ¶
type AppDeleteListener ¶
type AppUpdateListener ¶
type HandlerContext ¶
type HandlerContext interface { // Context return the context object Context() context.Context // Request returns the underlying http.Request object Request() *http.Request // Response returns the http.ResponseWriter Response() http.ResponseWriter // Overwrite value in the context Set(key string, value interface{}) }
Each handler can modify the context here so when it gets passed along, it will use the new info.
type RunnerListener ¶
type Server ¶
type Server struct { Datastore models.Datastore Runner *runner.Runner Router *gin.Engine MQ models.MessageQueue Enqueue models.Enqueue // contains filtered or unexported fields }
func New ¶
func New(ctx context.Context, ds models.Datastore, mq models.MessageQueue, apiURL string, opts ...ServerOption) *Server
func (*Server) AddAppCreateListener ¶
func (s *Server) AddAppCreateListener(listener AppCreateListener)
AddAppCreateListener adds a listener that will be notified on App created.
func (*Server) AddAppDeleteListener ¶
func (s *Server) AddAppDeleteListener(listener AppDeleteListener)
AddAppDeleteListener adds a listener that will be notified on App deleted.
func (*Server) AddAppUpdateListener ¶
func (s *Server) AddAppUpdateListener(listener AppUpdateListener)
AddAppUpdateListener adds a listener that will be notified on App updated.
func (*Server) AddRunnerListener ¶
func (s *Server) AddRunnerListener(listener RunnerListener)
AddRunListeners adds a listener that will be fired before and after a function run.
func (*Server) AddSpecialHandler ¶
func (s *Server) AddSpecialHandler(handler SpecialHandler)
func (*Server) FireAfterAppCreate ¶
func (*Server) FireAfterAppDelete ¶
func (*Server) FireAfterAppUpdate ¶
func (*Server) FireAfterDispatch ¶
func (*Server) FireBeforeAppCreate ¶
func (*Server) FireBeforeAppDelete ¶
func (*Server) FireBeforeAppUpdate ¶
func (*Server) FireBeforeDispatch ¶
type ServerOption ¶
type ServerOption func(*Server)
func EnableShutdownEndpoint ¶
func EnableShutdownEndpoint(halt context.CancelFunc) ServerOption
type SpecialHandler ¶
type SpecialHandler interface {
Handle(c HandlerContext) error
}
type SpecialHandlerContext ¶
type SpecialHandlerContext struct {
// contains filtered or unexported fields
}
func (*SpecialHandlerContext) Context ¶
func (c *SpecialHandlerContext) Context() context.Context
func (*SpecialHandlerContext) Request ¶
func (c *SpecialHandlerContext) Request() *http.Request
func (*SpecialHandlerContext) Response ¶
func (c *SpecialHandlerContext) Response() http.ResponseWriter
func (*SpecialHandlerContext) Set ¶
func (c *SpecialHandlerContext) Set(key string, value interface{})
Source Files ¶
- app_listeners.go
- apps_create.go
- apps_delete.go
- apps_get.go
- apps_list.go
- apps_update.go
- error_response.go
- ping.go
- routes_create.go
- routes_delete.go
- routes_get.go
- routes_list.go
- routes_update.go
- runner.go
- runner_listeners.go
- server.go
- server_options.go
- shutdown.go
- singleflight.go
- special_handler.go
- stats.go
- tree.go
- version.go
Directories ¶
Path | Synopsis |
---|---|
internal
|
|
routecache
Package routecache is meant to assist in resolving the most used routes at an application.
|
Package routecache is meant to assist in resolving the most used routes at an application. |
Click to show internal directories.
Click to hide internal directories.