Documentation ¶
Index ¶
- type DeltaStream
- type Stream
- type StreamState
- func (s *StreamState) GetKnownResourceNames(url string) map[string]struct{}
- func (s *StreamState) GetResourceVersions() map[string]string
- func (s *StreamState) GetSubscribedResourceNames() map[string]struct{}
- func (s *StreamState) IsFirst() bool
- func (s *StreamState) IsWildcard() bool
- func (s *StreamState) SetKnownResourceNames(url string, names map[string]struct{})
- func (s *StreamState) SetKnownResourceNamesAsList(url string, names []string)
- func (s *StreamState) SetResourceVersions(resourceVersions map[string]string)
- func (s *StreamState) SetSubscribedResourceNames(subscribedResourceNames map[string]struct{})
- func (s *StreamState) SetWildcard(wildcard bool)
- func (s *StreamState) WatchesResources(resourceNames map[string]struct{}) bool
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) }
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