router

package
v0.0.0-...-5facc9d Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2013 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Overview

Package router provides interfaces that need to be satisfied in order to implement a new router on tsuru.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register(name string, r Router)

Register registers a new router.

func Remove

func Remove(appName string) error

func Retrieve

func Retrieve(appName string) (string, error)

func Store

func Store(appName, routerName string) error

Store stores the app name related with the router name.

func Swap

func Swap(r Router, backend1, backend2 string) error

Types

type Router

type Router interface {
	AddBackend(name string) error
	RemoveBackend(name string) error
	AddRoute(name, address string) error
	RemoveRoute(name, address string) error
	SetCName(cname, name string) error
	UnsetCName(cname, name string) error
	Addr(name string) (string, error)

	// Swap change the router between two backends.
	Swap(string, string) error

	// Routes returns a list of routes of a backend.
	Routes(name string) ([]string, error)
}

Router is the basic interface of this package. It provides methods for managing backends and routes. Each backend can have multiple routes.

func Get

func Get(name string) (Router, error)

Get gets the named router from the registry.

Directories

Path Synopsis
Package hipache provides a router implementation that store routes in Redis, as specified by Hipache (https://github.com/dotcloud/hipache).
Package hipache provides a router implementation that store routes in Redis, as specified by Hipache (https://github.com/dotcloud/hipache).

Jump to

Keyboard shortcuts

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