cloudfoundry

package
v0.4.3 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2018 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const UpstreamTypeCF = "cloudfoundry"

Variables

View Source
var WrongUpstreamType error = errors.New("wrong upstream type")

Functions

func EncodeUpstreamSpec

func EncodeUpstreamSpec(spec UpstreamSpec) *types.Struct

func GetClient

func GetClient(address, caCert, clientCert, clientKey string) (copilot.IstioClient, error)

func GetClientFromOptions

func GetClientFromOptions(opts bootstrap.CoPilotOptions) (copilot.IstioClient, error)

func GetEndpointsForUpstream

func GetEndpointsForUpstream(ctx context.Context, client copilot.IstioClient, u *v1.Upstream) ([]endpointdiscovery.Endpoint, error)

func GetEndpointsFromResponse

func GetEndpointsFromResponse(resp *copilotapi.RoutesResponse, us *v1.Upstream) ([]endpointdiscovery.Endpoint, error)

func GetUpstreams

func GetUpstreams(ctx context.Context, client copilot.IstioClient) ([]*v1.Upstream, error)

func GetUpstreamsFromResponse

func GetUpstreamsFromResponse(resp *copilotapi.RoutesResponse) ([]*v1.Upstream, error)

func HostnameToUpstreamName

func HostnameToUpstreamName(hostname string) string

func MakeStopCancelContext

func MakeStopCancelContext(ctx context.Context, stop <-chan struct{}) (context.Context, context.CancelFunc)

func NewEndpointDiscovery

func NewEndpointDiscovery(ctx context.Context, client copilot.IstioClient, resyncDuration time.Duration) endpointdiscovery.Interface

func ResyncLoop

func ResyncLoop(ctx context.Context, stop <-chan struct{}, resync func(), resyncDuration time.Duration)

func ResyncLoopWithKick

func ResyncLoopWithKick(ctx context.Context, stop <-chan struct{}, resync func(), resyncDuration time.Duration, kick <-chan struct{})

func ResyncLoopWithTicker

func ResyncLoopWithTicker(ctx context.Context, resync func(), ticker <-chan time.Time, kick <-chan struct{})

Types

type Plugin

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

func (*Plugin) Init added in v0.4.2

func (p *Plugin) Init(options bootstrap.Options) error

func (*Plugin) ProcessUpstream

func (p *Plugin) ProcessUpstream(params *plugins.UpstreamPluginParams, in *v1.Upstream, out *envoyapi.Cluster) error

func (*Plugin) SetupEndpointDiscovery

func (p *Plugin) SetupEndpointDiscovery() (endpointdiscovery.Interface, error)

type UpstreamSpec

type UpstreamSpec struct {
	Hostname string `json:"hostname"`
}

func DecodeUpstreamSpec

func DecodeUpstreamSpec(generic v1.UpstreamSpec) (*UpstreamSpec, error)

Jump to

Keyboard shortcuts

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