stream

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2023 License: 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 Stream

type Stream interface {
	grpc.ServerStream

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

Generic RPC stream.

type StreamState

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

StreamState will keep track of resource 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{}

func (*StreamState) GetResourceVersions

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

func (*StreamState) GetSubscribedResourceNames

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

func (*StreamState) IsWildcard

func (s *StreamState) IsWildcard() bool

func (*StreamState) SetKnownResourceNames

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

func (*StreamState) SetKnownResourceNamesAsList

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

func (*StreamState) SetResourceVersions

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

func (*StreamState) SetSubscribedResourceNames

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

func (s *StreamState) SetWildcard(wildcard bool)

func (*StreamState) WatchesResources

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