handlers

package
v0.0.0-...-d691cb0 Latest Latest
Warning

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

Go to latest
Published: May 10, 2016 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package handlers is where the HTTP server work is done.

Index

Constants

This section is empty.

Variables

View Source
var STATIC_URL string
View Source
var TemplateBase string

Functions

func APIGetAssignedCount

func APIGetAssignedCount(c web.C, w http.ResponseWriter, r *http.Request)

func APIGetAssignedList

func APIGetAssignedList(c web.C, w http.ResponseWriter, r *http.Request)

func APIGetAvailableInventory

func APIGetAvailableInventory(c web.C, w http.ResponseWriter, r *http.Request)

func APIGetInstanceFromPort

func APIGetInstanceFromPort(c web.C, w http.ResponseWriter, r *http.Request)

func APIGetOpenPort

func APIGetOpenPort(c web.C, w http.ResponseWriter, r *http.Request)

func APIGetPortCapacity

func APIGetPortCapacity(c web.C, w http.ResponseWriter, r *http.Request)

func APIGetPortFromInstance

func APIGetPortFromInstance(c web.C, w http.ResponseWriter, r *http.Request)

func APIRemoveService

func APIRemoveService(c web.C, w http.ResponseWriter, r *http.Request)

func CommifyFloat

func CommifyFloat(bytes float64) string

CommifyFloat turns a float into a string with comma separation

func HumanizeBigBytes

func HumanizeBigBytes(bytes int64) string

HumanizeBigBytes transforms a uint64 to a human readable string such as "100Kb"

func HumanizeBytes

func HumanizeBytes(bytes int) string

HumanizeBytes transforms an int to a human readable string such as "100Kb"

func IntFromFloat64

func IntFromFloat64(incoming float64) (i int)

IntFromFloat64 provides a convenience function fo convert an int to a float insert screed about how you probably should not do it but sometimes you need to here.

func OkToBool

func OkToBool(ok string) bool

Turn an "ok" string into a boolean

Types

type PageContext

type PageContext struct {
	Title        string
	SubTitle     string
	Data         interface{}
	Static       string
	ViewTemplate string
	CurrentURL   string
	Refresh      bool
	RefreshTime  int
	RefreshURL   string
	Error        error
}

PageContext holds all the contextual information a page will want to return, use, or display

func NewPageContext

func NewPageContext() (pc PageContext, err error)

NewPageContext instantiates and returns a PageContext with "global" data already set.

Jump to

Keyboard shortcuts

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