Documentation ¶
Index ¶
- func Decode(ctx context.Context, name string) (proto.Message, error)
- func GetAmbassadorDrainTime(ctx context.Context) time.Duration
- func JoinEdsClustersV3(ctx context.Context, clusters []ecp_cache_types.Resource, ...) (endpoints []ecp_cache_types.Resource)
- func Main(ctx context.Context, Version string, getUsage MemoryGetter, ...) error
- func NewV3ExpandedSnapshot(v3snap *ecp_v3_cache.Snapshot) v3ExpandedSnapshot
- func Updater(ctx context.Context, updates <-chan Update, getUsage MemoryGetter) error
- func V3ListenerToRdsListener(lnr *v3listener.Listener) (*v3listener.Listener, []*v3route.RouteConfiguration, error)
- type Args
- type Endpoint
- type Endpoints
- type FastpathSnapshot
- type HasherV3
- type MemoryGetter
- type Update
- type Validatable
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetAmbassadorDrainTime ¶
The GetAmbassadorDrainTime function retuns the AMBASSADOR_DRAIN_TIME env var as a time.Duration
func JoinEdsClustersV3 ¶
func JoinEdsClustersV3(ctx context.Context, clusters []ecp_cache_types.Resource, edsEndpoints map[string]*v3endpoint.ClusterLoadAssignment, edsBypass bool) (endpoints []ecp_cache_types.Resource)
JoinEdsClustersV3 will perform an outer join operation between the eds clusters in the supplied clusterlist and the eds endpoint data in the supplied map. It will return a slice of ClusterLoadAssignments (cast to []ecp_cache_types.Resource) with endpoint data for all the eds clusters in the supplied list. If there is no map entry for a given cluster, an empty ClusterLoadAssignment will be synthesized. The result is a set of endpoints that are consistent (by the go-control-plane's definition of consistent) with the input clusters.
func Main ¶
func Main( ctx context.Context, Version string, getUsage MemoryGetter, fastpathCh <-chan *FastpathSnapshot, rawArgs ...string, ) error
func NewV3ExpandedSnapshot ¶
func NewV3ExpandedSnapshot(v3snap *ecp_v3_cache.Snapshot) v3ExpandedSnapshot
func Updater ¶
func Updater(ctx context.Context, updates <-chan Update, getUsage MemoryGetter) error
The Updator function will run forever (or until the ctx is canceled) and look for updates on the incoming channel. If memory usage is constrained as reported by the getUsage function, updates will be rate limited to guarantee that there are only so many stale configs in memory at a time. The function assumes updates are cumulative and it will drop old queued updates if a new update arrives.
func V3ListenerToRdsListener ¶
func V3ListenerToRdsListener(lnr *v3listener.Listener) (*v3listener.Listener, []*v3route.RouteConfiguration, error)
V3ListenerToRdsListener is the v3 variety of ListnerToRdsListener
Types ¶
type Endpoint ¶
Endpoint contains the subset of fields we bother to expose.
func (*Endpoint) ToLbEndpoint_v3 ¶
func (e *Endpoint) ToLbEndpoint_v3() *v3endpoint.LbEndpoint
ToLBEndpoint_v3 translates to envoy v3 frinedly form of the Endpoint data.
type Endpoints ¶
The Endpoints struct is how Endpoint data gets communicated to ambex. This is a bit simpler than the envoy endpoint data structures, and also provides us a layer of indirection to buffer us from changes in envoy configuration, e.g. we can switch from v2 to v3 endpoint data, or add v3 endpoint data fairly easily with this layer of indirection.
func (*Endpoints) RoutesString ¶
func (*Endpoints) ToMap_v3 ¶
func (e *Endpoints) ToMap_v3() map[string]*v3endpoint.ClusterLoadAssignment
ToMap_v3 produces a map with the envoy v3 friendly forms of all the endpoint data.
type FastpathSnapshot ¶
type FastpathSnapshot struct { Snapshot *ecp_v3_cache.Snapshot Endpoints *Endpoints }
FastpathSnapshot holds envoy configuration that bypasses python.
type MemoryGetter ¶
type MemoryGetter func() int
Function type for fetching memory usage as a percentage.
type Update ¶
An Update encapsulates everything needed to perform an update (of envoy configuration). The version string is for logging purposes, the Updator func does the actual work of updating.
type Validatable ¶
Not sure if there is a better way to do this, but we cast to this so we can call the generated Validate method.