response

package
v0.4.11 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2025 License: MIT Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertBatchDynamic added in v0.3.5

func ConvertBatchDynamic[E entities.Entity](entities []*E, responsePrototype any) ([]any, error)

func ConvertBatchTyped added in v0.3.5

func ConvertBatchTyped[E entities.Entity, T any](entities []*E) ([]T, error)

ConvertBatchTyped выполняет пакетное преобразование из []Entity в []T

func CopyEntityToResponse added in v0.3.5

func CopyEntityToResponse[E entities.Entity, R any](entity *E) (R, error)

CopyEntityToResponse копирует данные из entity в resp

func CopyEntityToResponseDynamic added in v0.3.5

func CopyEntityToResponseDynamic(entity any, responsePrototype any) (any, error)

func NewResponse added in v0.3.5

func NewResponse[R any]() R

Types

type ErrorResponse

type ErrorResponse struct {
	Error string `json:"error"`
}

type ResponseMarker added in v0.2.10

type ResponseMarker interface {
	AfterCopyFromEntity(entity any) error
}

ResponseMarker - маркерный интерфейс с хуками для кастомной логики

type SuccessResponse

type SuccessResponse struct {
	Success bool   `json:"success"`
	Message string `json:"message"`
}

Jump to

Keyboard shortcuts

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