models

package
v0.0.0-...-febdd24 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2014 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package models includes the models used for the gouter configuration

Index

Constants

View Source
const LOG_COLLECTION = "logs"
View Source
const ROUTE_COLLECTION = "routes"

Variables

This section is empty.

Functions

func CreateLog

func CreateLog(log Log) bool

Create a route from the provided route structure Returns true if the route was created successfully, or false if it already exists

func CreateRoute

func CreateRoute(route Route) bool

Create a route from the provided route structure Returns true if the route was created successfully, or false if it already exists

func DeleteRoute

func DeleteRoute(name string) bool

Delete the route from the database with the given route name Returns a true if successful or false if the route could not be found

Types

type Log

type Log struct {
	CreatedAt         string
	From              string
	To                string
	ProcessingTimeSec float64
	ResponseCode      int
}

Structure that the routes will be represented by

func LoadLogs

func LoadLogs() []Log

Load all of the logs from the database

type Route

type Route struct {
	Description string
	Name        string
	From        string
	To          string
}

Structure that the routes will be represented by

func FindRoute

func FindRoute(name string) Route

Finds the document in the collection for the given document name Returns the route if found, otherwise returns a blank route structure

func FindRouteByFrom

func FindRouteByFrom(from string) (Route, error)

func LoadRoutes

func LoadRoutes() []Route

Load all of the routes from the database

Jump to

Keyboard shortcuts

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