response

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package response provides functions for creating JSON responses.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Error

func Error(w http.ResponseWriter, status int, errMsg error)

func Success

func Success(w http.ResponseWriter, status int, data any)

Types

type Response

type Response struct {
	Error   string `json:"error,omitempty"`
	Success bool   `json:"success"`
	Data    any    `json:"data,omitempty"`
}

Jump to

Keyboard shortcuts

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