handler

package
v0.0.0-...-1185af5 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package handler provides common REST functionalities used in the REST server.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppendStandardHandlers

func AppendStandardHandlers(serviceName string, p *Provider)

AppendStandardHandlers registers non-api handlers.

func SetResponseModifier

func SetResponseModifier(p *Provider)

SetResponseModifier used to modify the Response status code using x-http-code header by setting a different code than 200 on success or 500 on failure.

Types

type Provider

type Provider struct {
	// Handlers contains non-api handlers to add to rest service.
	Handlers         []grpcRest.HandlerPathOption
	ResponseModifier func(context.Context, http.ResponseWriter, proto.Message) error
}

Provider defines service locator interface.

Jump to

Keyboard shortcuts

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