Documentation
¶
Index ¶
- type AfterCreate
- type AfterDelete
- type AfterGet
- type AfterList
- type AfterUpdate
- type BaseHandler
- type BeforeCreate
- type BeforeDelete
- type BeforeGet
- type BeforeList
- type BeforeUpdate
- type Create
- type Delete
- type Event
- type EventSelector
- type GenericHandler
- func (g *GenericHandler) AfterCreate(ctx context.Context, resource *model.Resource, params abs.RecordCreateParams, ...) errors.ServiceError
- func (g *GenericHandler) AfterDelete(ctx context.Context, resource *model.Resource, params abs.RecordDeleteParams) errors.ServiceError
- func (g *GenericHandler) AfterGet(ctx context.Context, resource *model.Resource, id string, res *model.Record) errors.ServiceError
- func (g *GenericHandler) AfterList(ctx context.Context, resource *model.Resource, params abs.RecordListParams, ...) errors.ServiceError
- func (g *GenericHandler) AfterUpdate(ctx context.Context, resource *model.Resource, params abs.RecordUpdateParams, ...) errors.ServiceError
- func (g *GenericHandler) BeforeCreate(ctx context.Context, resource *model.Resource, params abs.RecordCreateParams) errors.ServiceError
- func (g *GenericHandler) BeforeDelete(ctx context.Context, resource *model.Resource, params abs.RecordDeleteParams) errors.ServiceError
- func (g *GenericHandler) BeforeGet(ctx context.Context, resource *model.Resource, id string) errors.ServiceError
- func (g *GenericHandler) BeforeList(ctx context.Context, resource *model.Resource, params abs.RecordListParams) errors.ServiceError
- func (g *GenericHandler) BeforeUpdate(ctx context.Context, resource *model.Resource, params abs.RecordUpdateParams) errors.ServiceError
- func (g *GenericHandler) Create(ctx context.Context, resource *model.Resource, params abs.RecordCreateParams) (handled bool, records []*model.Record, inserted []bool, ...)
- func (g *GenericHandler) Delete(ctx context.Context, resource *model.Resource, params abs.RecordDeleteParams) (handled bool, err errors.ServiceError)
- func (g *GenericHandler) Get(ctx context.Context, resource *model.Resource, id string) (handled bool, record *model.Record, err errors.ServiceError)
- func (g *GenericHandler) List(ctx context.Context, resource *model.Resource, params abs.RecordListParams) (handled bool, records []*model.Record, total uint32, err errors.ServiceError)
- func (g *GenericHandler) Register(handler *BaseHandler)
- func (g *GenericHandler) RegisterWithSelector(handler *BaseHandler, selector EventSelector)
- func (g *GenericHandler) Unregister(handler *BaseHandler)
- func (g *GenericHandler) Update(ctx context.Context, resource *model.Resource, params abs.RecordUpdateParams) (handled bool, records []*model.Record, err errors.ServiceError)
- type Get
- type List
- type Update
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AfterCreate ¶
type AfterCreate func(ctx context.Context, resource *model.Resource, params abs.RecordCreateParams, records []*model.Record) errors.ServiceError
type AfterDelete ¶
type AfterDelete func(ctx context.Context, resource *model.Resource, params abs.RecordDeleteParams) errors.ServiceError
type AfterUpdate ¶
type AfterUpdate func(ctx context.Context, resource *model.Resource, params abs.RecordUpdateParams, records []*model.Record) errors.ServiceError
type BaseHandler ¶
type BaseHandler struct { Id string // list BeforeList BeforeList List List AfterList AfterList // create BeforeCreate BeforeCreate Create Create AfterCreate AfterCreate // update BeforeUpdate BeforeUpdate Update Update AfterUpdate AfterUpdate // get BeforeGet BeforeGet Get Get AfterGet AfterGet // delete BeforeDelete BeforeDelete Delete Delete AfterDelete AfterDelete }
type BeforeCreate ¶
type BeforeCreate func(ctx context.Context, resource *model.Resource, params abs.RecordCreateParams) errors.ServiceError
type BeforeDelete ¶
type BeforeDelete func(ctx context.Context, resource *model.Resource, params abs.RecordDeleteParams) errors.ServiceError
type BeforeList ¶
type BeforeList func(ctx context.Context, resource *model.Resource, params abs.RecordListParams) errors.ServiceError
type BeforeUpdate ¶
type BeforeUpdate func(ctx context.Context, resource *model.Resource, params abs.RecordUpdateParams) errors.ServiceError
type Delete ¶
type Delete func(ctx context.Context, resource *model.Resource, params abs.RecordDeleteParams) (handled bool, err errors.ServiceError)
type EventSelector ¶
func ResourceSelector ¶
func ResourceSelector(expectedResource *model.Resource) EventSelector
type GenericHandler ¶
type GenericHandler struct { BaseHandler // contains filtered or unexported fields }
func NewGenericHandler ¶
func NewGenericHandler() *GenericHandler
func (*GenericHandler) AfterCreate ¶
func (g *GenericHandler) AfterCreate(ctx context.Context, resource *model.Resource, params abs.RecordCreateParams, records []*model.Record) errors.ServiceError
func (*GenericHandler) AfterDelete ¶
func (g *GenericHandler) AfterDelete(ctx context.Context, resource *model.Resource, params abs.RecordDeleteParams) errors.ServiceError
func (*GenericHandler) AfterGet ¶
func (g *GenericHandler) AfterGet(ctx context.Context, resource *model.Resource, id string, res *model.Record) errors.ServiceError
func (*GenericHandler) AfterList ¶
func (g *GenericHandler) AfterList(ctx context.Context, resource *model.Resource, params abs.RecordListParams, records []*model.Record, total uint32) errors.ServiceError
func (*GenericHandler) AfterUpdate ¶
func (g *GenericHandler) AfterUpdate(ctx context.Context, resource *model.Resource, params abs.RecordUpdateParams, records []*model.Record) errors.ServiceError
func (*GenericHandler) BeforeCreate ¶
func (g *GenericHandler) BeforeCreate(ctx context.Context, resource *model.Resource, params abs.RecordCreateParams) errors.ServiceError
func (*GenericHandler) BeforeDelete ¶
func (g *GenericHandler) BeforeDelete(ctx context.Context, resource *model.Resource, params abs.RecordDeleteParams) errors.ServiceError
func (*GenericHandler) BeforeGet ¶
func (g *GenericHandler) BeforeGet(ctx context.Context, resource *model.Resource, id string) errors.ServiceError
func (*GenericHandler) BeforeList ¶
func (g *GenericHandler) BeforeList(ctx context.Context, resource *model.Resource, params abs.RecordListParams) errors.ServiceError
func (*GenericHandler) BeforeUpdate ¶
func (g *GenericHandler) BeforeUpdate(ctx context.Context, resource *model.Resource, params abs.RecordUpdateParams) errors.ServiceError
func (*GenericHandler) Create ¶
func (g *GenericHandler) Create(ctx context.Context, resource *model.Resource, params abs.RecordCreateParams) (handled bool, records []*model.Record, inserted []bool, err errors.ServiceError)
func (*GenericHandler) Delete ¶
func (g *GenericHandler) Delete(ctx context.Context, resource *model.Resource, params abs.RecordDeleteParams) (handled bool, err errors.ServiceError)
func (*GenericHandler) List ¶
func (g *GenericHandler) List(ctx context.Context, resource *model.Resource, params abs.RecordListParams) (handled bool, records []*model.Record, total uint32, err errors.ServiceError)
func (*GenericHandler) Register ¶
func (g *GenericHandler) Register(handler *BaseHandler)
func (*GenericHandler) RegisterWithSelector ¶
func (g *GenericHandler) RegisterWithSelector(handler *BaseHandler, selector EventSelector)
func (*GenericHandler) Unregister ¶
func (g *GenericHandler) Unregister(handler *BaseHandler)
func (*GenericHandler) Update ¶
func (g *GenericHandler) Update(ctx context.Context, resource *model.Resource, params abs.RecordUpdateParams) (handled bool, records []*model.Record, err errors.ServiceError)
Click to show internal directories.
Click to hide internal directories.