web

package
v0.0.0-...-bf7cbd6 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2022 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultErrorMessage = "Unexpected error."

Variables

This section is empty.

Functions

func ResponseHandler

func ResponseHandler(f ServerFunc) http.HandlerFunc

Types

type Coded

type Coded interface {
	Code() int
}

type Data

type Data interface{}

type Error

type Error struct {
	Message string `json:"message"`
}

type Messaged

type Messaged interface {
	Message() string
}

type Response

type Response struct {
	Error *Error      `json:"error,omitempty"`
	Data  interface{} `json:"data,omitempty"`
}

type ServerFunc

type ServerFunc func(w http.ResponseWriter, r *http.Request) (Data, error)

Jump to

Keyboard shortcuts

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