crud_invoke

package
v0.7.7 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Handle

func Handle(ctx context.Context, event Event, store *postgresql.Store) (any, error)

Types

type Crud

type Crud[TKey any, T Keyer[TKey]] struct {
	DataAccess rest.DataAccess[TKey, T]
}

func (Crud[TKey, T]) Handle

func (h Crud[TKey, T]) Handle(action string, raw json.RawMessage) (any, error)

type CrudHandler

type CrudHandler interface {
	Handle(action string, raw json.RawMessage) (any, error)
}

func CrudByName

func CrudByName(s *postgresql.Store, name string) CrudHandler

type Event

type Event struct {
	Type string          `json:"type"`
	Data json.RawMessage `json:"data"`
	Tf   EventTf         `json:"tf"`
}

func IsEvent

func IsEvent(rawEvent json.RawMessage) (bool, Event)

type EventTf

type EventTf struct {
	Action    string `json:"action"`
	PrevInput any    `json:"prev_input"`
}

type Keyer

type Keyer[TKey any] interface {
	Key() TKey
}

Jump to

Keyboard shortcuts

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