router

package
v0.0.0-...-925949f Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2015 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package router deals solely with managing the mapping from host prefix to routing information for requests directed there

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Pinged

func Pinged(r Route)

Pinged adds or updates the given Route's information in the routing table

Types

type Route

type Route struct {
	Prefix string `json:"prefix"`
	Port   int    `json:"port"`
	HTTPS  bool   `json:"https"`
	IP     net.IP `json:"-"`
	// contains filtered or unexported fields
}

Route describes a single endpoint which is accepting requests for the Route's prefix

func FindRoute

func FindRoute(host string, whitelistedSuffixes ...string) (Route, bool)

FindRoute returns an available Route for a request directed at the given host, or false if none is found. If any whitelistedSuffixes are given then host must have one of them, or no Route will be returned

Jump to

Keyboard shortcuts

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