router

package
v0.0.0-...-1d4c075 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Certificate

type Certificate struct {
	// ID is the unique ID of this Certificate
	ID string `json:"id,omitempty"`
	// Routes contains the IDs of routes assigned to this cert
	Routes []string `json:"routes,omitempty"`
	// TLSCert is the optional TLS public certificate. It is only used for HTTP routes.
	Cert string `json:"cert,omitempty"`
	// TLSCert is the optional TLS private key. It is only used for HTTP routes.
	Key string `json:"key,omitempty"`
	// CreatedAt is the time this cert was created.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UpdatedAt is the time this cert was last updated.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
}

Certificate describes a TLS certificate for one or more routes

type Event

type Event struct {
	Event string
	ID    string
	Route *Route
	Error error
}

type HTTPRoute

type HTTPRoute struct {
	ID        string
	ParentRef string
	Service   string
	Leader    bool
	CreatedAt time.Time
	UpdatedAt time.Time

	Domain        string
	Certificate   *Certificate `json:"certificate,omitempty"`
	LegacyTLSCert string       `json:"tls_cert,omitempty"`
	LegacyTLSKey  string       `json:"tls_key,omitempty"`
	Sticky        bool
	Path          string
}

HTTPRoute is an HTTP Route.

func (HTTPRoute) FormattedID

func (r HTTPRoute) FormattedID() string

func (HTTPRoute) MarshalJSON

func (r HTTPRoute) MarshalJSON() ([]byte, error)

func (HTTPRoute) ToRoute

func (r HTTPRoute) ToRoute() *Route

type Route

type Route struct {
	// Type is the type of Route, either "http" or "tcp".
	Type string `json:"type"`
	// ID is the unique ID of this route.
	ID string `json:"id,omitempty"`
	// ParentRef is an external opaque identifier used by the route creator for
	// filtering and correlation. It typically contains the app ID.
	ParentRef string `json:"parent_ref,omitempty"`
	// Service is the ID of the service.
	Service string `json:"service"`
	// Leader is whether or not traffic should only be routed to the leader or
	// all instances
	Leader bool `json:"leader"`
	// CreatedAt is the time this Route was created.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UpdatedAt is the time this Route was last updated.
	UpdatedAt time.Time `json:"updated_at,omitempty"`

	// Domain is the domain name of this Route. It is only used for HTTP routes.
	Domain string `json:"domain,omitempty"`

	// Certificate contains TLSCert and TLSKey
	Certificate *Certificate `json:"certificate,omitempty"`

	// Deprecated in favor of Certificate
	LegacyTLSCert string `json:"tls_cert,omitempty"`
	LegacyTLSKey  string `json:"tls_key,omitempty"`

	// Sticky is whether or not to use sticky sessions for this route. It is only
	// used for HTTP routes.
	Sticky bool `json:"sticky,omitempty"`
	// Path is the optional prefix to route to this service. It's exclusive with
	// the TLS options and can only be set if a "default" route with the same domain
	// and no Path already exists in the route table.
	Path string `json:"path,omitempty"`

	// Port is the TCP port to listen on for TCP Routes.
	Port int32 `json:"port,omitempty"`
}

Route is a struct that combines the fields of HTTPRoute and TCPRoute for easy JSON marshaling.

func (Route) FormattedID

func (r Route) FormattedID() string

func (Route) HTTPRoute

func (r Route) HTTPRoute() *HTTPRoute

func (Route) TCPRoute

func (r Route) TCPRoute() *TCPRoute

type StreamEvent

type StreamEvent struct {
	Event string `json:"event"`
	Route *Route `json:"route,omitempty"`
	Error error  `json:"error,omitempty"`
}

type TCPRoute

type TCPRoute struct {
	ID        string
	ParentRef string
	Service   string
	Leader    bool
	CreatedAt time.Time
	UpdatedAt time.Time

	Port int
}

TCPRoute is a TCP Route.

func (TCPRoute) FormattedID

func (r TCPRoute) FormattedID() string

func (TCPRoute) MarshalJSON

func (r TCPRoute) MarshalJSON() ([]byte, error)

func (TCPRoute) ToRoute

func (r TCPRoute) ToRoute() *Route

Jump to

Keyboard shortcuts

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