observer

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2024 License: MIT Imports: 3 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ModelObservers sync.Map

Functions

func AddObserver

func AddObserver(obsr ModelObserver)

func EmitObjectDeleted

func EmitObjectDeleted(object map[string]interface{}, entityName string, ctx context.Context)

func EmitObjectMultiDeleted

func EmitObjectMultiDeleted(objects []map[string]interface{}, entityName string, ctx context.Context)

func EmitObjectMultiPosted

func EmitObjectMultiPosted(objects []map[string]interface{}, entityName string, ctx context.Context)

func EmitObjectPosted

func EmitObjectPosted(object map[string]interface{}, entityName string, ctx context.Context)

func RemoveObserver

func RemoveObserver(key string)

Types

type ModelObserver

type ModelObserver interface {
	Key() string
	ObjectPosted(object map[string]interface{}, entityName string, ctx context.Context)
	ObjectMultiPosted(objects []map[string]interface{}, entityName string, ctx context.Context)
	ObjectDeleted(object map[string]interface{}, entityName string, ctx context.Context)
	ObjectMultiDeleted(objects []map[string]interface{}, entityName string, ctx context.Context)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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