http

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2023 License: MIT Imports: 17 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrHandlerTimeout = errors.New("http: Handler timeout")

ErrHandlerTimeout is returned on ResponseWriter Write calls in handlers which have timed out.

Functions

func OnError

func OnError(w http.ResponseWriter, _ *http.Request, err string)

Types

type GXHttpHandler

type GXHttpHandler interface {
	http.Handler
}

type GXHttpHandlerWithPaths

type GXHttpHandlerWithPaths interface {
	GXHttpHandler

	GetPaths() []string
}

type HandlerProviderFunc

type HandlerProviderFunc func(driver service.ModuleDriver) (GXHttpHandler, error)

type Metrics

type Metrics struct {
	// contains filtered or unexported fields
}

func NewMetrics

func NewMetrics(opts MetricsOptions) *Metrics

func (*Metrics) Handler

func (m *Metrics) Handler(h http.Handler) http.Handler

type MetricsOptions

type MetricsOptions struct {
	HostName    string
	ModuleName  string
	ProcessName string
	Paths       []string

	Registerer prometheus.Registerer
}

type Middleware

type Middleware struct {
	// contains filtered or unexported fields
}

func NewTimeOut

func NewTimeOut(opts TimeOutOptions) *Middleware

func (*Middleware) Handler

func (m *Middleware) Handler(h http.Handler) http.Handler

type ModuleConfig

type ModuleConfig struct {
	modules.ModuleConfig `mapstructure:",squash"`

	ReadTimeout int64 `mapstructure:"read_timeout"`

	WriteTimeout int64 `mapstructure:"write_timeout"`

	IdleTimeout int64 `mapstructure:"idle_timeout"`

	HandlerTimeout int64 `mapstructure:"handler_timeout"`

	DisableGzipMiddleware bool `mapstructure:"disable_gzip_middleware"`
}

type TimeOutOptions

type TimeOutOptions struct {
	Timeout      time.Duration
	ErrorHandler errorHandler
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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