Package handler provides http handlers



This section is empty.


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


This section is empty.


type Handler

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

Handler represents a HTTP handler that manages a request

type Option

type Option func(o *Options)

func WithClient

func WithClient(c client.Client) Option

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 {
	MaxRecvSize int64
	Namespace   string
	Router      router.Router
	Client      client.Client

func NewOptions

func NewOptions(opts ...Option) Options

NewOptions fills in the blanks


Path Synopsis
api Package api provides an http-rpc handler which provides the entire http request over rpc
event Package event provides a handler which publishes an event
http Package http is a http reverse proxy handler
rpc Package rpc is a go-micro rpc handler.
web Package web contains the web handler including websocket support