cloudfoundry

package
v0.0.0-...-35e2b90 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewServiceAccounts

func NewServiceAccounts() model.ServiceAccounts

NewServiceAccounts instantiates the Cloud Foundry service account interface

Types

type Config

type Config struct {
	Copilot CopilotConfig `yaml:"copilot"`

	// Cloud Foundry currently only supports applications exposing a single HTTP or TCP port
	// It is typically set to 8080.
	ServicePort int `yaml:"service_port" validate:"nonzero"`
}

Config for the Cloud Foundry platform adapter

func LoadConfig

func LoadConfig(path string) (*Config, error)

LoadConfig reads configuration data from a YAML file

func (*Config) ClientTLSConfig

func (c *Config) ClientTLSConfig() (*tls.Config, error)

ClientTLSConfig returns a tls.Config needed to instantiate a copilot.IstioClient

func (*Config) Save

func (c *Config) Save(path string) error

Save writes configuration data to a YAML file

type Controller

type Controller struct {
	Client copilotapi.IstioCopilotClient
	Ticker Ticker
	// contains filtered or unexported fields
}

Controller communicates with Cloud Foundry and monitors for changes

func (*Controller) AppendInstanceHandler

func (c *Controller) AppendInstanceHandler(f func(*model.ServiceInstance, model.Event)) error

AppendInstanceHandler implements a service catalog operation

func (*Controller) AppendServiceHandler

func (c *Controller) AppendServiceHandler(f func(*model.Service, model.Event)) error

AppendServiceHandler implements a service catalog operation

func (*Controller) Run

func (c *Controller) Run(stop <-chan struct{})

Run will loop, calling handlers in response to changes, until a signal is received

type CopilotClient

type CopilotClient interface {
	copilotapi.IstioCopilotClient
}

CopilotClient defines a local interface for interacting with Cloud Foundry Copilot

type CopilotConfig

type CopilotConfig struct {
	ServerCACertPath string        `yaml:"server_ca_cert_path" validate:"nonzero"`
	ClientCertPath   string        `yaml:"client_cert_path" validate:"nonzero"`
	ClientKeyPath    string        `yaml:"client_key_path" validate:"nonzero"`
	Address          string        `yaml:"address" validate:"nonzero"`
	PollInterval     time.Duration `yaml:"poll_interval" validate:"nonzero"`
}

CopilotConfig describes how the Cloud Foundry platform adapter can connect to the Cloud Foundry Copilot

type ServiceDiscovery

type ServiceDiscovery struct {
	Client CopilotClient

	// Cloud Foundry currently only supports applications exposing a single HTTP or TCP port
	// It is typically 8080
	ServicePort int
}

ServiceDiscovery implements the model.ServiceDiscovery interface for Cloud Foundry

func (*ServiceDiscovery) GetProxyServiceInstances

func (sd *ServiceDiscovery) GetProxyServiceInstances(proxy *model.Proxy) ([]*model.ServiceInstance, error)

GetProxyServiceInstances returns all service instances running on a particular proxy Cloud Foundry integration is currently ingress-only -- there is no sidecar support yet. So this function always returns an empty slice.

func (*ServiceDiscovery) GetService

func (sd *ServiceDiscovery) GetService(hostname string) (*model.Service, error)

GetService implements a service catalog operation

func (*ServiceDiscovery) Instances

func (sd *ServiceDiscovery) Instances(hostname string, ports []string, tagsList model.LabelsCollection) ([]*model.ServiceInstance, error)

Instances implements a service catalog operation

func (*ServiceDiscovery) ManagementPorts

func (sd *ServiceDiscovery) ManagementPorts(addr string) model.PortList

ManagementPorts is not currently implemented for Cloud Foundry

func (*ServiceDiscovery) Services

func (sd *ServiceDiscovery) Services() ([]*model.Service, error)

Services implements a service catalog operation

type Ticker

type Ticker interface {
	Chan() <-chan time.Time
	Stop()
}

Ticker acts like time.Ticker but is mockable for testing

func NewTicker

func NewTicker(d time.Duration) Ticker

NewTicker returns a Ticker used to instantiate a Controller

Jump to

Keyboard shortcuts

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