Files
fn-serverless/api/ifaces/listeners.go
Pedro Nasser 2c56e7975d Improve listeners and handlers (#350)
* improve listeners and handlers

* add to route handlers

* separate create/delete/update events

* removed useless interface
2016-11-29 00:00:12 +01:00

29 lines
947 B
Go

package ifaces
import (
"context"
"github.com/iron-io/functions/api/models"
)
type AppCreateListener interface {
// BeforeAppCreate called right before creating App in the database
BeforeAppCreate(ctx context.Context, app *models.App) error
// AfterAppCreate called after creating App in the database
AfterAppCreate(ctx context.Context, app *models.App) error
}
type AppUpdateListener interface {
// BeforeAppUpdate called right before updating App in the database
BeforeAppUpdate(ctx context.Context, app *models.App) error
// AfterAppUpdate called after updating App in the database
AfterAppUpdate(ctx context.Context, app *models.App) error
}
type AppDeleteListener interface {
// BeforeAppDelete called right before deleting App in the database
BeforeAppDelete(ctx context.Context, appName string) error
// AfterAppDelete called after deleting App in the database
AfterAppDelete(ctx context.Context, appName string) error
}