Documentation ¶
Overview ¶
Package adapter provides adapters between Turbine Labs API objects and envoy xDS objects, in the form of an xDS server and ClusterCollector implementations
Index ¶
Constants ¶
const ( // DefaultCluster is used as the Node's cluster name if none is provided DefaultCluster = "default-cluster" // DefaultZone is used as the Node's zone name if none is provided DefaultZone = "default-zone" )
Variables ¶
This section is empty.
Functions ¶
func NewClusterCollector ¶
func NewClusterCollector(addr, zoneName string, isJSON bool) (collector.ClusterCollector, error)
NewClusterCollector produces a ClusterCollector which connects to a CDS server on the given addr, and collects clusters for the given zone name. If isJSON is true, the JSON/REST transport will be used instead of gRPC.
Types ¶
type MockXDS ¶
type MockXDS struct {
// contains filtered or unexported fields
}
MockXDS is a mock of XDS interface
func NewMockXDS ¶
func NewMockXDS(ctrl *gomock.Controller) *MockXDS
NewMockXDS creates a new mock instance
func (*MockXDS) EXPECT ¶
func (m *MockXDS) EXPECT() *MockXDSMockRecorder
EXPECT returns an object that allows the caller to indicate expected use
type MockXDSFromFlags ¶
type MockXDSFromFlags struct {
// contains filtered or unexported fields
}
MockXDSFromFlags is a mock of XDSFromFlags interface
func NewMockXDSFromFlags ¶
func NewMockXDSFromFlags(ctrl *gomock.Controller) *MockXDSFromFlags
NewMockXDSFromFlags creates a new mock instance
func (*MockXDSFromFlags) EXPECT ¶
func (m *MockXDSFromFlags) EXPECT() *MockXDSFromFlagsMockRecorder
EXPECT returns an object that allows the caller to indicate expected use
func (*MockXDSFromFlags) Make ¶
func (m *MockXDSFromFlags) Make(registrar poller.Registrar) (XDS, error)
Make mocks base method
func (*MockXDSFromFlags) Validate ¶
func (m *MockXDSFromFlags) Validate() error
Validate mocks base method
type MockXDSFromFlagsMockRecorder ¶
type MockXDSFromFlagsMockRecorder struct {
// contains filtered or unexported fields
}
MockXDSFromFlagsMockRecorder is the mock recorder for MockXDSFromFlags
func (*MockXDSFromFlagsMockRecorder) Make ¶
func (mr *MockXDSFromFlagsMockRecorder) Make(registrar interface{}) *gomock.Call
Make indicates an expected call of Make
func (*MockXDSFromFlagsMockRecorder) Validate ¶
func (mr *MockXDSFromFlagsMockRecorder) Validate() *gomock.Call
Validate indicates an expected call of Validate
type MockXDSMockRecorder ¶
type MockXDSMockRecorder struct {
// contains filtered or unexported fields
}
MockXDSMockRecorder is the mock recorder for MockXDS
func (*MockXDSMockRecorder) Addr ¶
func (mr *MockXDSMockRecorder) Addr() *gomock.Call
Addr indicates an expected call of Addr
func (*MockXDSMockRecorder) Consume ¶
func (mr *MockXDSMockRecorder) Consume(arg0 interface{}) *gomock.Call
Consume indicates an expected call of Consume
func (*MockXDSMockRecorder) Run ¶
func (mr *MockXDSMockRecorder) Run() *gomock.Call
Run indicates an expected call of Run
func (*MockXDSMockRecorder) Stop ¶
func (mr *MockXDSMockRecorder) Stop() *gomock.Call
Stop indicates an expected call of Stop
type XDS ¶
type XDS interface { poller.Consumer // Run starts the XDS server. This method does not return unless // the server fails to start or is stopped from another goroutine // via Stop(). Run() error // Stop terminates a running XDS server. It attempts a graceful stop by // preventing new connections and waiting until pending RPCs are complete. Stop() // Addr retrieves the XDS server's listener address. Suitable for // retrieving the listener port when the initial address specified // port 0. If the server has not yet started, this method blocks. Addr() string }
XDS manages the lifecyle of an envoy xDS server. It also implements poller.Consumer, to allow it to consume objects from the Turbine Labs API.
func NewXDS ¶
func NewXDS( addr string, registrar poller.Registrar, caFile string, defaultTimeout time.Duration, resolveDNS bool, stats stats.Stats, options ...XDSOption, ) (XDS, error)
NewXDS creates new XDS instances with the given listener address, object source, certificate authority file, and default timeout.
type XDSFromFlags ¶
type XDSFromFlags interface { // Make creates an XDS from the given poller.Registrar and command line flags. Make(registrar poller.Registrar) (XDS, error) // Validate verifies that all flags are correctly specified Validate() error }
XDSFromFlags configures and validates an XDS
func NewXDSFromFlags ¶
func NewXDSFromFlags( flags tbnflag.FlagSet, statsFromFlags stats.FromFlags, ) XDSFromFlags
NewXDSFromFlags installs a FromFlags in the given FlagSet
Source Files ¶
- adapter.go
- als.go
- als_reporter.go
- caching_consumer.go
- caching_consumer_stats.go
- cds.go
- cluster_collector.go
- cluster_transformer.go
- discovery_service.go
- eds.go
- escape.go
- grpc_client.go
- lds.go
- mock_adapter.go
- mock_caching_consumer.go
- mock_snapshot_cache.go
- mock_static_resources.go
- mock_xds.go
- mock_xds_fromflags.go
- rds.go
- rest_client.go
- route_exploder.go
- snapshot_cache.go
- static_resources.go
- xds.go
- xds_fromflags.go