utils

package
v0.2.0-rc.2 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decode

func Decode[T any](r *http.Request) (T, error)

func Encode

func Encode[T any](w http.ResponseWriter, r *http.Request, status int, message string, v T) error

func Error

func Error(w http.ResponseWriter, rerr int, err error)

Types

type ErrorResponse

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

type SuccessResponse

type SuccessResponse struct {
	Message string `json:"message"`
	Data    any    `json:"data"`
}

Jump to

Keyboard shortcuts

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