gwv

package module
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2015 License: MIT Imports: 17 Imported by: 0

README

GWV β

Golang Web Valve - to be connected to your series of tubes

Build Status Build status Coverage Status codecov.io Coverage Status GoDoc

install

go get -u -t simonwaldherr.de/go/gwv

features

  • HTTP Server
  • HTTPS Server
  • SPDY Server
  • Static File Server
  • Automatic SSL cert generator
  • Realtime Webserver (SSE)

license

MIT (see LICENSE file)

it depends on:

Documentation

Index

Constants

View Source
const (
	AUTO mimeCtrl = iota
	HTML
	JSON
	ICON
	PLAIN
	REDIRECT
	DOWNLOAD
)

Variables

This section is empty.

Functions

func CheckSSL

func CheckSSL(certPath string, keyPath string) error

func GenerateSSL

func GenerateSSL(options map[string]string) error

Types

type Connections

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

type HandlerWrapper added in v0.2.0

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

func Download

func Download(re string, view handler) *HandlerWrapper

func Favicon

func Favicon(path string) *HandlerWrapper

func Humans

func Humans(data string) *HandlerWrapper

func Redirect

func Redirect(path, destination string, code int) *HandlerWrapper

func Robots

func Robots(data string) *HandlerWrapper

func SSE

func SSE(re string, hub *Connections, ch chan string) *HandlerWrapper

func StaticFiles

func StaticFiles(reqpath string, paths ...string) *HandlerWrapper

func URL

func URL(re string, view handler, handler mimeCtrl) *HandlerWrapper

func (*HandlerWrapper) String added in v0.2.0

func (u *HandlerWrapper) String() string

type WebServer

type WebServer struct {
	WG      sync.WaitGroup
	Stop    bool
	LogChan chan string
	// contains filtered or unexported fields
}

func NewWebServer

func NewWebServer(port int, timeout time.Duration) *WebServer

func (*WebServer) ConfigSSL

func (GWV *WebServer) ConfigSSL(port int, sslkey string, sslcert string, spdy bool)

func (*WebServer) Handler404

func (GWV *WebServer) Handler404(fn handler)

func (*WebServer) Handler500

func (GWV *WebServer) Handler500(fn handler)

func (*WebServer) InitLogChan added in v0.2.0

func (GWV *WebServer) InitLogChan()

func (*WebServer) InitRealtimeHub

func (GWV *WebServer) InitRealtimeHub() *Connections

func (*WebServer) ServeHTTP

func (GWV *WebServer) ServeHTTP(rw http.ResponseWriter, req *http.Request)

func (*WebServer) Start

func (GWV *WebServer) Start()

func (*WebServer) URLhandler

func (GWV *WebServer) URLhandler(patterns ...*HandlerWrapper)

Jump to

Keyboard shortcuts

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