http

package
v1.2.9 Latest Latest
Warning

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

Go to latest
Published: May 2, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API interface {
	CheckUpdate(s api.CheckState) error
	Stats() (api.Stats, error)
}

API defines the shape of the services that the http.REST exposes.

type ErrorResponse

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

ErrorResponse represents and http response when an error processing a request occurs.

type REST

type REST struct {
	// contains filtered or unexported fields
}

REST exposes an API using http REST endpoints.

func NewREST

func NewREST(log log.Logger, a API, router *httprouter.Router) *REST

NewREST returns a REST components that exposes a given API using http REST endpoints through the given router.

type Router

type Router interface {
	GET(path string, handle httprouter.Handle)
	PATCH(path string, handle httprouter.Handle)
}

type StatsResponse

type StatsResponse struct {
	api.Stats `json:"stats"`
}

StatsResponse represents a stats response.

Jump to

Keyboard shortcuts

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