client

package
v0.0.0-...-8488f5b Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2016 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Overview

Package client provides a client for the router API.

Index

Constants

This section is empty.

Variables

View Source
var ErrNotFound = errors.New("router: route not found")

ErrNotFound is returned when no route was found.

Functions

This section is empty.

Types

type Client

type Client interface {
	// CreateRoute creates a new route.
	CreateRoute(*router.Route) error
	// UpdateRoute updates an existing route by overwriting all fields on the route
	// except ID and Domain.
	UpdateRoute(*router.Route) error
	// DeleteRoute deletes the route with the specified routeType and id.
	DeleteRoute(routeType, id string) error
	// GetRoute returns a route with the specified routeType and id.
	GetRoute(routeType, id string) (*router.Route, error)
	// ListRoutes returns a list of routes. If parentRef is not empty, routes
	// are filtered by the reference (ex: "controller/apps/myapp").
	ListRoutes(parentRef string) ([]*router.Route, error)
	StreamEvents(output chan *router.StreamEvent) (stream.Stream, error)

	// CreateCert creates a new route certificate.
	CreateCert(*router.Certificate) error
	// GetCert returns a route cert with specified id.
	GetCert(id string) (*router.Certificate, error)
	// DeleteCert deletes the route certificate with the specified id.
	DeleteCert(id string) error
	// ListCerts returns a list of certificates.
	ListCerts() ([]*router.Certificate, error)
	// ListCertRoutes returns a list of routes assigned to the specified certificate.
	ListCertRoutes(id string) ([]*router.Route, error)
}

Client is a client for the router API.

func New

func New() Client

New uses the default discoverd client and returns a client.

func NewWithAddr

func NewWithAddr(addr string) Client

NewWithAddr uses addr as the specified API url and returns a client.

func NewWithHTTP

func NewWithHTTP(http *http.Client) Client

NewWithHTTP does the same thing as New but uses the given *http.Client

Jump to

Keyboard shortcuts

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