hook

package
v0.1.22 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultAfterInsert

func DefaultAfterInsert(model interface{})

func DefaultBeforeInsert

func DefaultBeforeInsert(model interface{})

func IsHookieEnabled added in v0.1.5

func IsHookieEnabled(model interface{}) bool

IsHookieEnabled Function to check if a model contains BaseModel or an audit marker (like hook.Inject)

func RegisterModel

func RegisterModel(model interface{})

RegisterModel Register the model for audit logging

func WatchAndInjectHooks added in v0.1.5

func WatchAndInjectHooks(rootDir string, ctx context.Context) error

WatchAndInjectHooks finds structs with hookie.Inject and calls their hooks

Types

type TypeRegistry added in v0.1.9

type TypeRegistry struct {
	// contains filtered or unexported fields
}

func NewTypeRegistry added in v0.1.9

func NewTypeRegistry() *TypeRegistry

func (*TypeRegistry) Lookup added in v0.1.9

func (tr *TypeRegistry) Lookup(pkgPath, typeName string) (reflect.Type, bool)

func (*TypeRegistry) Register added in v0.1.9

func (tr *TypeRegistry) Register(pkgPath, typeName string, typ reflect.Type)

Jump to

Keyboard shortcuts

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