api

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2023 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddJSONContentType

func AddJSONContentType(w http.ResponseWriter)

func RespondWithError

func RespondWithError(ctx context.Context, w http.ResponseWriter, err error)

Types

type Error

type Error struct {
	Code   int    `json:"code"`
	Title  string `json:"title"`
	Detail string `json:"detail"`
	Type   string `json:"type"`
}

Error Follows RFC7807 (https://datatracker.ietf.org/doc/html/rfc7807)

func (Error) Error

func (e Error) Error() string

Jump to

Keyboard shortcuts

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