Documentation
¶
Index ¶
- func Parse[T any](in []byte) (T, *types.CommonError)
- type Handler
- func (c *Handler[T]) Delete(ctx context.Context, userID string, refIDs []string, ID string) (t T, err *types.CommonError)
- func (c *Handler[T]) Get(ctx context.Context, namespace string, refIDs []string, ID string) ([]T, *types.CommonError)
- func (c *Handler[T]) Post(ctx context.Context, data T, meta any) (T, *types.CommonError)
- type HandlerWithAttachment
- func (c *HandlerWithAttachment) Attach(ctx context.Context, meta *entity.Attachment, payload io.Reader) (*entity.Attachment, *types.CommonError)
- func (c *HandlerWithAttachment) Delete(ctx context.Context, userID string, refIDs []string, ID string) (*entity.Attachment, *types.CommonError)
- func (c *HandlerWithAttachment) Get(ctx context.Context, userID string, refIDs []string, ID string) ([]*entity.Attachment, *types.CommonError)
- func (c *HandlerWithAttachment) GetAttachment(ctx context.Context, userID string, refIDs []string, ID string) (payload io.ReadCloser, meta *entity.Attachment, err *types.CommonError)
- func (c *HandlerWithAttachment) Put(ctx context.Context, content *entity.Attachment) (*entity.Attachment, *types.CommonError)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Handler ¶
func (*Handler[T]) Delete ¶
func (c *Handler[T]) Delete(ctx context.Context, userID string, refIDs []string, ID string) (t T, err *types.CommonError)
Delete your resource here the implementation can check whether there are linked resource or not
type HandlerWithAttachment ¶
type HandlerWithAttachment struct {
*Handler[*entity.Attachment]
// contains filtered or unexported fields
}
func NewAttachment ¶
func NewAttachment( repo content.Repository, refSize int, blobRepo blob.Repository, hideUrl bool, namespace string, ) *HandlerWithAttachment
NewWithAttachment creates the basic CRUD handle, but enables attachment Whether this is private or not will mostly be depended by the blob repository
func (*HandlerWithAttachment) Attach ¶
func (c *HandlerWithAttachment) Attach(ctx context.Context, meta *entity.Attachment, payload io.Reader) (*entity.Attachment, *types.CommonError)
func (*HandlerWithAttachment) Delete ¶
func (c *HandlerWithAttachment) Delete(ctx context.Context, userID string, refIDs []string, ID string) (*entity.Attachment, *types.CommonError)
DeleteAttachment generic binary at path
func (*HandlerWithAttachment) Get ¶
func (c *HandlerWithAttachment) Get(ctx context.Context, userID string, refIDs []string, ID string) ([]*entity.Attachment, *types.CommonError)
Overwrite for censoring
func (*HandlerWithAttachment) GetAttachment ¶
func (c *HandlerWithAttachment) GetAttachment(ctx context.Context, userID string, refIDs []string, ID string) (payload io.ReadCloser, meta *entity.Attachment, err *types.CommonError)
BETA
func (*HandlerWithAttachment) Put ¶
func (c *HandlerWithAttachment) Put(ctx context.Context, content *entity.Attachment) (*entity.Attachment, *types.CommonError)
Put disables the default put behaviour
Click to show internal directories.
Click to hide internal directories.