http

package module
v0.0.0-...-6ad7431 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2022 License: MIT Imports: 12 Imported by: 0

README

[Plugin] Rumors http server

Installation

go get github.com/rumorsflow/http

Documentation

Index

Constants

View Source
const PluginName = "http"

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	DirCache          string        `mapstructure:"dir_cache"`
	HostWhitelist     []string      `mapstructure:"host_whitelist"`
	CertFile          string        `mapstructure:"cert_file"`
	KeyFile           string        `mapstructure:"key_file"`
	Address           string        `mapstructure:"address"`
	Middleware        []string      `mapstructure:"middleware"`
	MaxHeaderBytes    int           `mapstructure:"max_header_bytes"`
	ReadHeaderTimeout time.Duration `mapstructure:"read_header_timeout"`
	ReadTimeout       time.Duration `mapstructure:"read_timeout"`
	WriteTimeout      time.Duration `mapstructure:"write_timeout"`
	IdleTimeout       time.Duration `mapstructure:"idle_timeout"`
	Static            []struct {
		Dir     string   `mapstructure:"dir"`
		Pattern string   `mapstructure:"pattern"`
		Methods []string `mapstructure:"methods"`
	} `mapstructure:"static"`
}

func (*Config) InitDefault

func (cfg *Config) InitDefault()

func (*Config) IsTLS

func (cfg *Config) IsTLS() bool

func (*Config) Server

func (cfg *Config) Server(handler http.Handler) *http.Server

func (*Config) TLSConfig

func (cfg *Config) TLSConfig() *tls.Config

type Handler

type Handler interface {
	Register(mux *flow.Mux)
}

type Middleware

type Middleware interface {
	Handle(http.Handler) http.Handler
}

type Plugin

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

func (*Plugin) AddHandler

func (p *Plugin) AddHandler(name endure.Named, handler Handler)

func (*Plugin) AddMiddleware

func (p *Plugin) AddMiddleware(name endure.Named, middleware Middleware)

func (*Plugin) Collects

func (p *Plugin) Collects() []any

func (*Plugin) Init

func (p *Plugin) Init(cfg config.Configurer, log *zap.Logger) error

func (*Plugin) Name

func (p *Plugin) Name() string

Name returns user-friendly plugin name

func (*Plugin) Serve

func (p *Plugin) Serve() chan error

func (*Plugin) Stop

func (p *Plugin) Stop() error

Directories

Path Synopsis
middleware
www

Jump to

Keyboard shortcuts

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