transport

package
v1.1.27 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AttachRoutes

func AttachRoutes(handlers *Handlers) http.Handler

AttachRoutes wire handlers with routes

func HTTPGenerateXRequestID

func HTTPGenerateXRequestID() kithttp.RequestFunc

HTTPGenerateXRequestID gets or create a request id token.

func HTTPRequestEndpoint

func HTTPRequestEndpoint(endpoint string) kithttp.RequestFunc

HTTPRequestEndpoint includes a new request ctx entry indicating which endpoint was requested.

func HTTPRequestLogger

func HTTPRequestLogger(logger kitlog.Logger, exclude string) kithttp.RequestFunc

func HTTPReturnXRequestID

func HTTPReturnXRequestID() kithttp.ServerResponseFunc

Types

type CustomCtxKey

type CustomCtxKey int

CustomCtxKey represents a custom key type for API requests context.

const (
	// ContextKeyEndpoint is the context key
	// for the requested API endpoint.
	ContextKeyEndpoint CustomCtxKey = iota
)

type Handlers

type Handlers struct {
	Healthcheck   http.Handler
	CreateScan    http.Handler
	ListScans     http.Handler
	GetScan       http.Handler
	GetScanChecks http.Handler
	GetScanStats  http.Handler
	GetCheck      http.Handler
	AbortScan     http.Handler
}

Handlers contains all available handlers for this api

func MakeHandlers

func MakeHandlers(e *endpoint.Endpoints, logger kitlog.Logger) *Handlers

MakeHandlers returns initialized handlers

Jump to

Keyboard shortcuts

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