engine

package
v2.0.0-beta.1+incompat... Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2016 License: MIT Imports: 3 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Address      string
	TLSCertfile  string
	TLSKeyfile   string
	ReadTimeout  time.Duration
	WriteTimeout time.Duration
}

Config defines engine configuration.

type Engine

type Engine interface {
	SetHandler(Handler)
	SetLogger(*log.Logger)
	Start()
}

Engine defines an interface for HTTP server.

type Handler

type Handler interface {
	ServeHTTP(Request, Response)
}

type HandlerFunc

type HandlerFunc func(Request, Response)

func (HandlerFunc) ServeHTTP

func (h HandlerFunc) ServeHTTP(req Request, res Response)
type Header interface {
	Add(string, string)
	Del(string)
	Get(string) string
	Set(string, string)
}

Header defines an interface for HTTP header.

type Request

type Request interface {
	TLS() bool
	Scheme() string
	Host() string
	URI() string
	URL() URL
	Header() Header
	// Proto() string
	// ProtoMajor() int
	// ProtoMinor() int
	RemoteAddress() string
	Method() string
	Body() io.ReadCloser
	FormValue(string) string
}

Request defines an interface for HTTP request.

type Response

type Response interface {
	Header() Header
	WriteHeader(int)
	Write(b []byte) (int, error)
	Status() int
	Size() int64
	Committed() bool
	SetWriter(io.Writer)
	Writer() io.Writer
}

Response defines an interface for HTTP response.

type URL

type URL interface {
	SetPath(string)
	Path() string
	QueryValue(string) string
}

URL defines an interface for HTTP request url.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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