routefetcher

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2018 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TokenFetchErrors      = "token_fetch_errors"
	SubscribeEventsErrors = "subscribe_events_errors"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type HTTPFetcher

type HTTPFetcher struct {
	RouteRegistry registry.Registry

	UaaClient uaa_client.Client
	// contains filtered or unexported fields
}

HTTPFetcher knows how to connect to the routing API and get tcp events and satisfies RouteClient interface

func NewHTTPFetcher

func NewHTTPFetcher(
	logger logger.Logger,
	UaaClient uaa_client.Client,
	client routing_api.Client,
	RouteRegistry registry.Registry,
) *HTTPFetcher

NewHTTPFetcher returns a http fetcher

func (*HTTPFetcher) ClientProtocol

func (httpFetcher *HTTPFetcher) ClientProtocol() string

func (*HTTPFetcher) FetchRoutes

func (httpFetcher *HTTPFetcher) FetchRoutes() error

func (*HTTPFetcher) HandleEvent

func (httpFetcher *HTTPFetcher) HandleEvent(event interface{})

type RouteClient

type RouteClient interface {
	FetchRoutes() error
	HandleEvent(interface{})
	ClientProtocol() string
}

type RouteFetcher

type RouteFetcher struct {
	UaaClient                          uaa_client.Client
	FetchRoutesInterval                time.Duration
	SubscriptionRetryIntervalInSeconds int
	// contains filtered or unexported fields
}

func NewRouteFetcher

func NewRouteFetcher(
	logger logger.Logger,
	uaaClient uaa_client.Client,
	cfg *config.Config,
	client routing_api.Client,
	subscriptionRetryInterval int,
	clock clock.Clock,
	rc RouteClient,
) *RouteFetcher

NewRouteFetcher knows how to subscribe to the routing api

func (*RouteFetcher) Run

func (r *RouteFetcher) Run(signals <-chan os.Signal, ready chan<- struct{}) error

type TCPFetcher

type TCPFetcher struct {
	// contains filtered or unexported fields
}

TCPFetcher knows how to connect to the routing API and get tcp events satisfies RouteClient interface

func NewTCPFetcher

func NewTCPFetcher(
	logger logger.Logger,
	routingTable routingtable.RouteTable,
	routingAPIClient routing_api.Client,
	uaaClient uaaclient.Client,
) *TCPFetcher

NewTCPFetcher initializes a TCPFetcher

func (*TCPFetcher) ClientProtocol

func (tcpFetcher *TCPFetcher) ClientProtocol() string

ClientProtocol returns the protocol of the RouteClient

func (*TCPFetcher) FetchRoutes

func (tcpFetcher *TCPFetcher) FetchRoutes() error

FetchRoutes grabs the current state from the API server and will update RouteTable if differences exist

func (*TCPFetcher) HandleEvent

func (tcpFetcher *TCPFetcher) HandleEvent(e interface{})

HandleEvent handles events from the api client

Jump to

Keyboard shortcuts

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