Documentation ¶
Index ¶
- type ChannelVersion
- type Locality
- type Request
- type RequestV2
- func (r *RequestV2) CreateWatch(scope tally.Scope) Watch
- func (r *RequestV2) GetCluster() string
- func (r *RequestV2) GetError() *status.Status
- func (r *RequestV2) GetLocality() *Locality
- func (r *RequestV2) GetNodeID() string
- func (r *RequestV2) GetNodeMetadata() *structpb.Struct
- func (r *RequestV2) GetRaw() *RequestVersion
- func (r *RequestV2) GetResourceNames() []string
- func (r *RequestV2) GetResponseNonce() string
- func (r *RequestV2) GetTypeURL() string
- func (r *RequestV2) GetVersionInfo() string
- type RequestV3
- func (r *RequestV3) CreateWatch(scope tally.Scope) Watch
- func (r *RequestV3) GetCluster() string
- func (r *RequestV3) GetError() *status.Status
- func (r *RequestV3) GetLocality() *Locality
- func (r *RequestV3) GetNodeID() string
- func (r *RequestV3) GetNodeMetadata() *structpb.Struct
- func (r *RequestV3) GetRaw() *RequestVersion
- func (r *RequestV3) GetResourceNames() []string
- func (r *RequestV3) GetResponseNonce() string
- func (r *RequestV3) GetTypeURL() string
- func (r *RequestV3) GetVersionInfo() string
- type RequestVersion
- type Response
- type ResponseV2
- type ResponseV3
- type ResponseVersion
- type Stream
- type Watch
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChannelVersion ¶
ChannelVersion wraps v2 and v3 response channels
type Locality ¶
Locality is an interface to abstract the differences between the v2 and v3 Locality type
type Request ¶
type Request interface { GetResourceNames() []string GetTypeURL() string GetVersionInfo() string GetNodeID() string GetNodeMetadata() *structpb.Struct GetCluster() string GetError() *status.Status GetLocality() *Locality GetResponseNonce() string GetRaw() *RequestVersion CreateWatch(scope tally.Scope) Watch }
Request is the generic interface to abstract v2 and v3 DiscoveryRequest types
type RequestV2 ¶
type RequestV2 struct {
// contains filtered or unexported fields
}
RequestV2 is the v2.DiscoveryRequest impl of Request
func NewRequestV2 ¶
func NewRequestV2(r *discoveryv2.DiscoveryRequest) *RequestV2
NewRequestV2 creates a Request objects which wraps v2.DiscoveryRequest
func (*RequestV2) CreateWatch ¶
CreateWatch creates a versioned Watch
func (*RequestV2) GetCluster ¶
GetCluster gets the cluster name
func (*RequestV2) GetLocality ¶
GetLocality gets the node locality
func (*RequestV2) GetNodeMetadata ¶
GetNodeMetadata gets version-agnostic node metadata
func (*RequestV2) GetRaw ¶
func (r *RequestV2) GetRaw() *RequestVersion
GetRaw gets the error details
func (*RequestV2) GetResourceNames ¶
GetResourceNames gets the ResourceNames
func (*RequestV2) GetResponseNonce ¶
GetResponseNonce gets the error details
func (*RequestV2) GetTypeURL ¶
GetTypeURL gets the error details
func (*RequestV2) GetVersionInfo ¶
GetVersionInfo gets the version info
type RequestV3 ¶
type RequestV3 struct {
// contains filtered or unexported fields
}
RequestV3 is the v2.DiscoveryRequest impl of Request
func NewRequestV3 ¶
func NewRequestV3(r *discoveryv3.DiscoveryRequest) *RequestV3
NewRequestV3 creates a Request objects which wraps v2.DiscoveryRequest
func (*RequestV3) CreateWatch ¶
CreateWatch creates a versioned Watch
func (*RequestV3) GetCluster ¶
GetCluster gets the cluster name
func (*RequestV3) GetLocality ¶
GetLocality gets the node locality
func (*RequestV3) GetNodeMetadata ¶
GetNodeMetadata gets version-agnostic node metadata
func (*RequestV3) GetRaw ¶
func (r *RequestV3) GetRaw() *RequestVersion
GetRaw gets the error details
func (*RequestV3) GetResourceNames ¶
GetResourceNames gets the ResourceNames
func (*RequestV3) GetResponseNonce ¶
GetResponseNonce gets the error details
func (*RequestV3) GetTypeURL ¶
GetTypeURL gets the error details
func (*RequestV3) GetVersionInfo ¶
GetVersionInfo gets the version info
type RequestVersion ¶
type RequestVersion struct { V2 *discoveryv2.DiscoveryRequest V3 *discoveryv3.DiscoveryRequest }
RequestVersion holds either one of the v2/v3 DiscoveryRequests
type Response ¶
type Response interface { GetPayloadVersion() string GetNonce() string GetTypeURL() string GetRequest() *RequestVersion Get() *ResponseVersion GetResources() []*any.Any }
Response is the generic response interface
func NewResponseV2 ¶
func NewResponseV2(req *discoveryv2.DiscoveryRequest, resp *discoveryv2.DiscoveryResponse) Response
NewResponseV2 creates a new instance of wrapped Response
func NewResponseV3 ¶
func NewResponseV3(req *discoveryv3.DiscoveryRequest, resp *discoveryv3.DiscoveryResponse) Response
NewResponseV3 creates a new instance of wrapped Response
type ResponseV2 ¶
type ResponseV2 struct {
// contains filtered or unexported fields
}
ResponseV2 is the v2.DiscoveryRequest impl of Response
func (*ResponseV2) Get ¶
func (r *ResponseV2) Get() *ResponseVersion
Get returns the original discovery response
func (*ResponseV2) GetNonce ¶
func (r *ResponseV2) GetNonce() string
GetNonce gets the response nonce
func (*ResponseV2) GetPayloadVersion ¶
func (r *ResponseV2) GetPayloadVersion() string
GetPayloadVersion gets the api version
func (*ResponseV2) GetRequest ¶
func (r *ResponseV2) GetRequest() *RequestVersion
GetRequest returns the original request associated with the response
func (*ResponseV2) GetResources ¶
func (r *ResponseV2) GetResources() []*any.Any
GetResources returns the original discovery response
func (*ResponseV2) GetTypeURL ¶
func (r *ResponseV2) GetTypeURL() string
GetTypeURL returns the typeUrl for the resource
type ResponseV3 ¶
type ResponseV3 struct {
// contains filtered or unexported fields
}
ResponseV3 is the v3.DiscoveryRequest impl of Response
func (*ResponseV3) Get ¶
func (r *ResponseV3) Get() *ResponseVersion
Get returns the original discovery response
func (*ResponseV3) GetNonce ¶
func (r *ResponseV3) GetNonce() string
GetNonce gets the response nonce
func (*ResponseV3) GetPayloadVersion ¶
func (r *ResponseV3) GetPayloadVersion() string
GetPayloadVersion gets the api version
func (*ResponseV3) GetRequest ¶
func (r *ResponseV3) GetRequest() *RequestVersion
GetRequest returns the original request associated with the response
func (*ResponseV3) GetResources ¶
func (r *ResponseV3) GetResources() []*any.Any
GetResources returns the original discovery response
func (*ResponseV3) GetTypeURL ¶
func (r *ResponseV3) GetTypeURL() string
GetTypeURL returns the typeUrl for the resource
type ResponseVersion ¶
type ResponseVersion struct { V2 *discoveryv2.DiscoveryResponse V3 *discoveryv3.DiscoveryResponse }
ResponseVersion holds either one of the v2/v3 DiscoveryRequests
type Stream ¶
type Stream interface { SendMsg(version string, nonce string, metadata string) error RecvMsg() (Response, error) CloseSend() error }
Stream abstracts the grpc client stream and DiscoveryRequest/Response
func NewStreamV2 ¶
NewStreamV2 creates a new wrapped transport stream
func NewStreamV3 ¶
NewStreamV3 creates a new wrapped transport stream
type Watch ¶
type Watch interface { // Close is idempotent with Send. // When Close and Send are called from separate goroutines they are guaranteed to not panic // Close waits until all Send operations drain. Close() GetChannel() *ChannelVersion // Send is a mutex protected function to send responses to the downstream sidecars. // It provides guarantee to never panic when called in tandem with Close from separate // goroutines. This also guarantees that stale responses are dropped in the event that a // newer response arrives. Send(Response) error }
Watch interface abstracts v2 and v3 watches to the downstream sidecars.