package stream

import "github.com/envoyproxy/go-control-plane/pkg/server/stream/v3"

Index

Types

type DeltaStream

type DeltaStream interface {
	grpc.ServerStream

	Send(*discovery.DeltaDiscoveryResponse) error
	Recv() (*discovery.DeltaDiscoveryRequest, error)
}

Generic RPC Stream for the delta based xDS protocol.

type Stream

type Stream interface {
	grpc.ServerStream

	Send(*discovery.DiscoveryResponse) error
	Recv() (*discovery.DiscoveryRequest, error)
}

Generic RPC stream for state of the world.

type Subscription

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

Subscription stores the server view of a given type subscription in a stream.

func NewDeltaSubscription

func NewDeltaSubscription(subscribed, unsubscribed []string, initialResourceVersions map[string]string, allowLegacyWildcard bool) Subscription

func NewSotwSubscription

func NewSotwSubscription(subscribed []string, allowLegacyWildcard bool) Subscription

func (Subscription) IsWildcard

func (s Subscription) IsWildcard() bool

IsWildcard returns whether or not the subscription currently has a wildcard watch

func (Subscription) ReturnedResources

func (s Subscription) ReturnedResources() map[string]string

ReturnedResources returns the list of resources returned to the client and their version

func (*Subscription) SetResourceSubscription

func (s *Subscription) SetResourceSubscription(subscribed []string)

SetResourceSubscription updates the subscribed resources (including the wildcard state) based on the full state of subscribed resources provided in the request Used in sotw subscriptions Behavior is based on https://www.envoyproxy.io/docs/envoy/latest/api-docs/xds_protocol#how-the-client-specifies-what-resources-to-return

func (*Subscription) SetReturnedResources

func (s *Subscription) SetReturnedResources(resourceVersions map[string]string)

SetReturnedResources sets a list of resource versions currently known by the client The cache can use this state to compute resources added/updated/deleted

func (Subscription) SubscribedResources

func (s Subscription) SubscribedResources() map[string]struct{}

SubscribedResources returns the list of resources currently explicitly subscribed to If the request is set to wildcard it may be empty

func (*Subscription) UpdateResourceSubscriptions

func (s *Subscription) UpdateResourceSubscriptions(subscribed, unsubscribed []string)

UpdateResourceSubscriptions updates the subscribed resources (including the wildcard state) based on newly subscribed or unsubscribed resources Used in delta subscriptions

Source Files

stream.go subscription.go

Version
v0.14.0 (latest)
Published
Nov 4, 2025
Platform
linux/amd64
Imports
2 packages
Last checked
4 months ago

Tools for package owners.