response

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2025 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseService

type BaseService struct{}

BaseService provides common HTTP response utilities that can be embedded and specialized

func NewBaseService

func NewBaseService() *BaseService

NewBaseService creates a new base response service

func (*BaseService) Error

func (s *BaseService) Error(c *fiber.Ctx, status int, message, errorType, code string) error

Error sends an error response with specified status, type, and code

func (*BaseService) Success

func (s *BaseService) Success(c *fiber.Ctx, data any) error

Success sends a 200 OK response with the provided data

type ErrorDetail

type ErrorDetail struct {
	Message string `json:"message"`
	Type    string `json:"type"`
	Code    string `json:"code"`
}

ErrorDetail contains error information

type ErrorResponse

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

ErrorResponse represents a standard API error response

Jump to

Keyboard shortcuts

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