host

package
v0.0.0-...-3244a0f Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2014 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NO_TRANSFORM       = iota
	MARKDOWN_TRANSFORM = iota
	REDIRECT_TRANSFORM = iota
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Host

type Host struct {
	// Host name
	Name string
	// Main directory
	DocumentRoot string
	// Main path
	Path string
	// Settings
	Settings *yaml.Yaml
	// Templates (not fully functional yet)
	Templates map[string]*template.Template
	// Function map for templates.
	template.FuncMap
	// Standard request.
	*http.Request
	// Standard response writer.
	http.ResponseWriter

	// File watcher
	//Watcher *fsnotify.Watcher
	Watcher *watcher.Watcher
	// Template root
	TemplateRoot string
	// contains filtered or unexported fields
}

Virtual host that serves document of a given directory.

func New

func New(name string, root string) (*Host, error)

Creates and returns a host.

func (*Host) Close

func (self *Host) Close()

func (*Host) ServeHTTP

func (host *Host) ServeHTTP(w http.ResponseWriter, req *http.Request)

A simple ServeHTTP.

Jump to

Keyboard shortcuts

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