host

package
v0.9.3 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2016 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

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
}

Host is the struct that represents virtual hosts.

func New

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

New creates and returns a host.

func (*Host) Close

func (host *Host) Close()

Close removes the watcher that is currently associated with the host.

func (*Host) ServeHTTP

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

ServeHTTP reads a request and creates an appropriate response.

Jump to

Keyboard shortcuts

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