response

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2024 License: MPL-2.0 Imports: 4 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(w http.ResponseWriter, err error)
	RespondWithJSON(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