response

package
v0.52.0 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2026 License: MPL-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package response providers support for returning http responses

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ErrorCodeToStatusCode

func ErrorCodeToStatusCode(code te.CodeType) int

ErrorCodeToStatusCode maps an error code string to a http status code integer.

Types

type Writer

type Writer interface {
	RespondWithError(ctx context.Context, w http.ResponseWriter, err error)
	RespondWithJSON(ctx context.Context, w http.ResponseWriter, model interface{}, statusCode int)
}

Writer provides utility functions for responding to http requests

func NewWriter

func NewWriter(logger logger.Logger) Writer

NewWriter creates an instance of Writer

Jump to

Keyboard shortcuts

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