api

package
Version: v0.7.7 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register(rootRouter *mux.Router, context *Context)

Register registers the API endpoints on the given router.

Types

type Context

type Context struct {
	RequestID string
	Logger    logrus.FieldLogger
}

Context provides the API with all necessary data and interfaces for responding to requests.

It is cloned before each request, allowing per-request changes such as logger annotations.

func (*Context) Clone

func (c *Context) Clone() *Context

Clone creates a shallow copy of context, allowing clones to apply per-request changes.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL