crud

package
v0.23.2 Latest Latest
Warning

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

Go to latest
Published: May 3, 2026 License: MIT Imports: 0 Imported by: 0

Documentation

Overview

Package crud carries zero-sized marker types used as the first generic parameter of nexus.On[A, T] to identify which CRUD action a handler overrides.

Lives in its own subpackage so call sites read naturally:

nexus.On[crud.Create, User](func(ctx context.Context, db *gorm.DB, u *User) error { ... })

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action interface {
	Create | Read | Update | Delete | List
}

Action is the type-set constraint that admits exactly the five CRUD action markers above. Used as the first generic parameter of nexus.On so the compiler rejects nexus.On[BogusType, User](...).

type Create

type Create struct{}

Create marks the POST <plural> action that inserts a new record.

type Delete

type Delete struct{}

Delete marks the DELETE <plural>/:id action that removes a record.

type List

type List struct{}

List marks the GET <plural> action that returns a paginated set.

type Read

type Read struct{}

Read marks the GET <plural>/:id action that loads one record by id.

type Update

type Update struct{}

Update marks the PATCH <plural>/:id action that merges a partial update into an existing record.

Jump to

Keyboard shortcuts

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