events

package
v4.1.6 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2022 License: MIT Imports: 9 Imported by: 1

Documentation

Index

Constants

View Source
const (
	PaginationEvent   = Event("pagination")
	BeforeCreateEvent = Event("before_create")
	BeforeUpdateEvent = Event("before_update")
	BeforeDeleteEvent = Event("before_delete")
	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 {
	Query   *elastic.BoolQuery
	Filters []paginations.Filter
}

type Event

type Event string

func (Event) String

func (e Event) String() string

type GormPagination

type GormPagination struct {
	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 {
	Query         *mgm.Collection
	Filters       []paginations.Filter
	MongoDbFilter bson.M
}

Jump to

Keyboard shortcuts

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