crud

package
v0.0.0-...-3ce7580 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New[T any](
	repo content.Repository[T],
	wrap func(T) mycontent.Data,
	validate func(T) *types.CommonError,
	urlFormat URLFormat,
) *crud[T]

func NewAttachment

func NewAttachment(
	repo content.Repository[*entity.Attachment],
	blobRepo blob.Repository,
	hideUrl bool,
	namespace string,
	urlFormat URLFormat,
) *crudWithAttachment

NewWithAttachment creates the basic CRUD handle, but enables attachment Whether this is private or not will mostly be depended by the blob repository

func NewWithHook

func NewWithHook[T any](
	repo content.Repository[T],
	wrap func(T) mycontent.Data,
	validate func(T) *types.CommonError,
	updateHook mycontent.UpdateHook[T],
	urlFormat URLFormat,
) *crudWithHook[T]

Types

type URLFormat

type URLFormat func(dataPath, userID, refID, ID string) string

URLFormat for custom URL (this should be the URL default)

Jump to

Keyboard shortcuts

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