Help us shape the future of Go! Take the 2026 Go Developer Survey

api

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2019 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Federate

func Federate(w http.ResponseWriter, req *http.Request)

Federate handles GET /federate.

func NewV1Handler

func NewV1Handler(keystone keystone.Driver, storage storage.Driver) http.Handler

NewV1Handler creates a http.Handler that serves the Maia v1 API. It also returns the VersionData for this API version which is needed for the version advertisement on "GET /".

func ReturnJSON

func ReturnJSON(w http.ResponseWriter, code int, data interface{})

ReturnJSON is a convenience function for HTTP handlers returning JSON data. The `code` argument specifies the HTTP Response code, usually 200.

func ReturnPromError

func ReturnPromError(w http.ResponseWriter, err error, code int)

ReturnPromError produces a Prometheus error Response with HTTP Status code

func ReturnResponse

func ReturnResponse(w http.ResponseWriter, response *http.Response)

ReturnResponse basically forwards a received Response.

func Server

func Server() error

Server initializes and starts the API server, hooking it up to the API router

Types

type VersionData

type VersionData struct {
	Status string            `json:"status"`
	ID     string            `json:"id"`
	Links  []versionLinkData `json:"links"`
}

VersionData is used by version advertisement handlers.

Jump to

Keyboard shortcuts

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