events

package
v4.3.11 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2024 License: MIT Imports: 9 Imported by: 1

Documentation

Index

Constants

View Source
const (
	PaginationEvent   = Event("pagination")
	BeforeValidation  = Event("before_validation")
	BeforeCreateEvent = Event("before_create")
	BeforeUpdateEvent = Event("before_update")
	BeforeDeleteEvent = Event("before_delete")
	AfterValidation   = Event("after_validation")
	AfterCreateEvent  = Event("after_create")
	AfterUpdateEvent  = Event("after_update")
	AfterDeleteEvent  = Event("after_delete")
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Dispatcher

type Dispatcher struct {
	Events map[string][]Listener
}

func (*Dispatcher) Dispatch

func (d *Dispatcher) Dispatch(event string, payload interface{}) error

func (*Dispatcher) Register

func (d *Dispatcher) Register(listeners []Listener)

type ElasticsearchPagination

type ElasticsearchPagination struct {
	Model   interface{}
	Query   *elastic.BoolQuery
	Filters paginations.Filter
}

type Event

type Event string

func (Event) String

func (e Event) String() string

type GormPagination

type GormPagination struct {
	Model   interface{}
	Query   *gorm.DB
	Filters paginations.Filter
}

type Listener

type Listener interface {
	Handle(event interface{}) interface{}
	Listen() string
	Priority() int
}

type Model

type Model struct {
	Data       interface{}
	Id         string
	Repository repositories.Repository
}

type MongodbPagination

type MongodbPagination struct {
	Model         interface{}
	Query         *mgm.Collection
	Filters       paginations.Filter
	MongoDbFilter bson.M
}

type Validation added in v4.3.0

type Validation struct {
	Data    interface{}
	IsError bool
	Message string
}

Jump to

Keyboard shortcuts

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