httpserver

package
v0.0.0-...-ef933ab Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2014 License: LGPL-3.0 Imports: 11 Imported by: 0

Documentation

Overview

The httpserver package can be used in a charm to implement an http server. The port of the server is configured with the "server-port" charm configuration option, which should be added to config.yaml with integer type.

This package is currently highly experimental.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

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

func (*Server) PrivateAddress

func (srv *Server) PrivateAddress() (string, error)

PrivateAddress returns the TCP address of the HTTP server. If the server is not running, it returns the empty string.

type ServerGetter

type ServerGetter func(*hook.Context) (*Server, error)

ServerGetter returns a Server instance from a hook context.

func Register

func Register(r *hook.Registry, newHandler func() http.Handler) ServerGetter

Register registers the handlers and commands necessary for starting an http server in a charm that will serve content using the handler created by calling newHandler.

Jump to

Keyboard shortcuts

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