dto

package
v1.10.21 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2026 License: AGPL-3.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ErrorInfo

type ErrorInfo struct {
	StatusCode int    `json:"status_code"`
	Code       string `json:"code"`
	Message    string `json:"message"`
	Error      string `json:"error"`
}

ErrorInfo holds error details.

type ErrorResponseBody

type ErrorResponseBody struct {
	Success bool       `json:"success"`
	Data    any        `json:"data"`
	Error   *ErrorInfo `json:"error"`
}

ErrorResponseBody is the error envelope returned by the custom error handler.

type MessageData

type MessageData struct {
	Message string `json:"message"`
}

MessageData is a simple message payload for Response[MessageData].

type Pageable

type Pageable struct {
	CurrentPage   int   `json:"current_page"`
	Size          int   `json:"size"`
	TotalPages    int   `json:"total_pages"`
	TotalElements int64 `json:"total_elements"`
	Empty         bool  `json:"empty"`
}

Pageable holds pagination metadata.

type PageableResponse

type PageableResponse[T any] struct {
	Success  bool     `json:"success"`
	Data     []T      `json:"data"`
	Pageable Pageable `json:"pageable"`
}

PageableResponse is the paginated API response envelope.

type Response

type Response[T any] struct {
	Success bool `json:"success"`
	Data    T    `json:"data"`
}

Response is the standard API response envelope with a generic data field.

Jump to

Keyboard shortcuts

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