handler

package
v3.9.3 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package handler provides http handlers

Index

Constants

This section is empty.

Variables

View Source
var DefaultMaxRecvSize int64 = 1024 * 1024 * 100 // 10Mb

DefaultMaxRecvSize specifies max recv size for handler

Functions

This section is empty.

Types

type Handler

type Handler interface {
	// standard http handler
	http.Handler
	// name of handler
	String() string
}

Handler represents a HTTP handler that manages a request

type Option

type Option func(o *Options)

Option func signature

func WithClient

func WithClient(c client.Client) Option

WithClient specifies client to be used by the handler

func WithMaxRecvSize

func WithMaxRecvSize(size int64) Option

WithMaxRecvSize specifies max body size

func WithNamespace

func WithNamespace(s string) Option

WithNamespace specifies the namespace for the handler

func WithRouter

func WithRouter(r router.Router) Option

WithRouter specifies a router to be used by the handler

type Options

type Options struct {
	Router      router.Router
	Client      client.Client
	Logger      logger.Logger
	Namespace   string
	MaxRecvSize int64
}

Options struct holds handler options

func NewOptions

func NewOptions(opts ...Option) Options

NewOptions creates new options struct and fills it

Jump to

Keyboard shortcuts

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