Documentation ¶
Overview ¶
package crud contains helpers to handle CRUD (Create, Read, Update and Delete) requests that work on persistence.StorageOperations in a common way.
Index ¶
- func Create[T any, S persistence.StorageObject](obj S, op persistence.StorageOperations[S], convert func(obj S) *T) (res *connect.Response[T], err error)
- func Delete[S persistence.StorageObject](key any, op persistence.StorageOperations[S]) (res *connect.Response[emptypb.Empty], err error)
- func Get[T any, S persistence.StorageObject](key any, op persistence.StorageOperations[S], convert func(obj S) *T) (res *connect.Response[T], err error)
- func List[T any, S persistence.StorageObject](op persistence.StorageOperations[S], ...) (res *connect.Response[T], err error)
- func Update[T any, S persistence.StorageObject](key any, in S, paths []string, op persistence.StorageOperations[S], ...) (res *connect.Response[T], err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Create ¶
func Create[T any, S persistence.StorageObject](obj S, op persistence.StorageOperations[S], convert func(obj S) *T) (res *connect.Response[T], err error)
func Delete ¶
func Delete[S persistence.StorageObject](key any, op persistence.StorageOperations[S]) (res *connect.Response[emptypb.Empty], err error)
func Get ¶
func Get[T any, S persistence.StorageObject](key any, op persistence.StorageOperations[S], convert func(obj S) *T) (res *connect.Response[T], err error)
func List ¶
func List[T any, S persistence.StorageObject](op persistence.StorageOperations[S], setter func(res *connect.Response[T], list []S) error, args ...any) (res *connect.Response[T], err error)
func Update ¶
func Update[T any, S persistence.StorageObject](key any, in S, paths []string, op persistence.StorageOperations[S], convert func(obj S) *T) (res *connect.Response[T], err error)
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.