agent

package
v0.0.0-...-dcdb1c8 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2019 License: Apache-2.0 Imports: 37 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetNodeID

func GetNodeID(agent Agent) string

GetNodeID returns the envoy metadata ID for pilot's service discovery.

Types

type Agent

type Agent interface {
	io.Closer
	// GetConfig returns the ServiceEntry configuration for this agent.
	GetConfig() model.Config
	// GetAdminPort returns the Envoy administration port for this agent.
	GetAdminPort() int
	// GetPorts returns a list of port mappings between Envoy and the backend application.
	GetPorts() []*MappedPort
	// IsConfiguredForService indicates whether this agent has received configuration for communication with the given service.
	CheckConfiguredForService(target Agent) error
}

Agent is a wrapper around an Envoy proxy that has been configured for a particular backend Application.

type Factory

type Factory func(serviceName, version string, serviceManager *service.Manager, appFactory application.Factory, portMgr reserveport.PortManager) (Agent, error)

Factory is a function that manufactures Agent instances.

type MappedPort

type MappedPort struct {
	Name            string
	Protocol        model.Protocol
	ProxyPort       int
	ApplicationPort int
}

MappedPort provides a single port mapping between an Envoy proxy and its backend application.

func FindFirstPortForProtocol

func FindFirstPortForProtocol(a Agent, protocol model.Protocol) (*MappedPort, error)

FindFirstPortForProtocol is a utility method to simplify lookup of a port for a given protocol.

type PilotAgentFactory

type PilotAgentFactory struct {
	DiscoveryAddress *net.TCPAddr
	TmpDir           string
	EnvoyLogLevel    envoy.LogLevel
}

PilotAgentFactory is responsible for manufacturing agent.Agent instances which use Pilot for configuration.

func (*PilotAgentFactory) NewAgent

func (f *PilotAgentFactory) NewAgent(serviceName, version string, serviceManager *service.Manager, appFactory application.Factory,
	portMgr reserveport.PortManager) (Agent, error)

NewAgent is an agent.Factory function that creates new agent.Agent instances which use Pilot for configuration

Jump to

Keyboard shortcuts

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