fox

package
v0.0.0-...-08bf4ff Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2016 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Add

func Add(w http.ResponseWriter, r *http.Request)

Add is a handler for adding a fox to the registry

func Compare

func Compare(a, b Fox) bool

Compare compares two foxes

func Delete

func Delete(w http.ResponseWriter, r *http.Request)

Delete is a handler for deleting a fox

func DeleteFoxFromStorage

func DeleteFoxFromStorage(uuid string)

Deletes the fox, if it exists. Does nothing if it does not

func FoxExists

func FoxExists(uuid string) bool

func List

func List(w http.ResponseWriter, r *http.Request)

List is a handler for returning a list of foxes

func NewRouter

func NewRouter() *mux.Router

func Show

func Show(w http.ResponseWriter, r *http.Request)

Show ia s handler for returning a specific fox

func Update

func Update(w http.ResponseWriter, r *http.Request)

Update is a handler for updating a fox. If a fox exists, it is removed first

Types

type Fox

type Fox struct {
	Name    string   `json:"name"`
	Parents []string `json:"parents"`
	Uuid    string   `json:"uuid"`
}

func GetFoxes

func GetFoxes() ([]Fox, error)

func ReadFox

func ReadFox(uuid string) (Fox, error)

type Route

type Route struct {
	Name        string
	Method      string
	Pattern     string
	HandlerFunc http.HandlerFunc
	Role        string
}

func (Route) String

func (r Route) String() string

type Routes

type Routes []Route

type Statistics

type Statistics struct {
	TimeSinceLastOK      int64  `json:"timeSinceLastOK"`
	TimeSinceLastNOK     int64  `json:"timeSinceLastNOK"`
	ParallelRequestCount int    `json:"currentRequestCount"`
	NodeName             string `json:"nodeName"`
}

type UUID

type UUID struct {
	Uuid string `json:"uuid"`
}

func StoreFox

func StoreFox(fox Fox, uuid string) UUID

StoreFox persists the fox instance to somewhere

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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