crud

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

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

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 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.

Jump to

Keyboard shortcuts

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