stream

package
v3.9.1 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2023 License: Apache-2.0, Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

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 StreamState

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

StreamState will keep track of resource cache state per type on a stream.

func NewStreamState

func NewStreamState(wildcard bool, initialResourceVersions map[string]string) StreamState

NewStreamState initializes a stream state.

func (*StreamState) GetKnownResourceNames

func (s *StreamState) GetKnownResourceNames(url string) map[string]struct{}

GetKnownResourceNames returns the current known list of resources on a SOTW stream.

func (*StreamState) GetResourceVersions

func (s *StreamState) GetResourceVersions() map[string]string

GetResourceVersions returns a map of current resources grouped by type URL.

func (*StreamState) GetSubscribedResourceNames added in v3.2.0

func (s *StreamState) GetSubscribedResourceNames() map[string]struct{}

GetSubscribedResourceNames returns the list of resources currently explicitly subscribed to If the request is set to wildcard it may be empty Currently populated only when using delta-xds

func (*StreamState) IsFirst

func (s *StreamState) IsFirst() bool

IsFirst returns whether or not the state of the stream is based upon the initial request.

func (*StreamState) IsWildcard

func (s *StreamState) IsWildcard() bool

IsWildcard returns whether or not an xDS client requested in wildcard mode on the initial request.

func (*StreamState) SetKnownResourceNames

func (s *StreamState) SetKnownResourceNames(url string, names map[string]struct{})

SetKnownResourceNames sets a list of resource names in a stream utilizing the SOTW protocol.

func (*StreamState) SetKnownResourceNamesAsList

func (s *StreamState) SetKnownResourceNamesAsList(url string, names []string)

SetKnownResourceNamesAsList is a helper function to set resource names as a slice input.

func (*StreamState) SetResourceVersions

func (s *StreamState) SetResourceVersions(resourceVersions map[string]string)

SetResourceVersions sets a list of resource versions by type URL and removes the flag of "first" since we can safely assume another request has come through the stream.

func (*StreamState) SetSubscribedResourceNames added in v3.2.0

func (s *StreamState) SetSubscribedResourceNames(subscribedResourceNames map[string]struct{})

SetSubscribedResourceNames is setting the list of resources currently explicitly subscribed to It is decorrelated from the wildcard state of the stream Currently used only when using delta-xds

func (*StreamState) SetWildcard added in v3.2.0

func (s *StreamState) SetWildcard(wildcard bool)

func (*StreamState) WatchesResources added in v3.2.0

func (s *StreamState) WatchesResources(resourceNames map[string]struct{}) bool

WatchesResources returns whether at least one of the resource provided is currently watch by the stream It is currently only applicable to delta-xds If the request is wildcard, it will always return true Otherwise it will compare the provided resources to the list of resources currently subscribed

Jump to

Keyboard shortcuts

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