grpc_service_config

package
v0.41.3 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ServiceConfig_LoadBalancingPolicy_name = map[int32]string{
		0: "UNSPECIFIED",
		1: "ROUND_ROBIN",
	}
	ServiceConfig_LoadBalancingPolicy_value = map[string]int32{
		"UNSPECIFIED": 0,
		"ROUND_ROBIN": 1,
	}
)

Enum value maps for ServiceConfig_LoadBalancingPolicy.

View Source
var File_grpc_service_config_proto protoreflect.FileDescriptor

Functions

func ToMillis added in v0.14.4

func ToMillis(d *duration.Duration) int64

ToMillis returns the given Duration as milliseconds.

Types

type Config added in v0.14.4

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

Config represents parsed mapping of the gRPC ServiceConfig contents with methods for increased accessibility.

func New added in v0.14.4

func New(in io.Reader) (Config, error)

New traverses the given gRPC ServiceConfig into more accessible constructs mapped by the names to the specific config values. Use the accessors on the resulting Config to retrieve values for a Service or Method.

func (Config) RequestLimit added in v0.14.4

func (c Config) RequestLimit(s, m string) (int, bool)

RequestLimit returns the request limit in bytes and a presence flag for the given fully-qualified Service and simple Method names. A config assignment for a specific Method takes precendence over a Service-level assignment.

func (Config) ResponseLimit added in v0.14.4

func (c Config) ResponseLimit(s, m string) (int, bool)

ResponseLimit returns the response limit in bytes and a presence flag for the given fully-qualified Service and simple Method names. A config assignment for a specific Method takes precendence over a Service-level assignment.

func (Config) RetryPolicy added in v0.14.4

func (c Config) RetryPolicy(s, m string) (*MethodConfig_RetryPolicy, bool)

RetryPolicy returns the retryPolicy and a presence flag for the given fully-qualified Service and simple Method names. A config assignment for a specific Method takes precendence over a Service-level assignment.

func (Config) Timeout added in v0.14.4

func (c Config) Timeout(s, m string) (int64, bool)

Timeout returns the timeout in milliseconds and a presence flag for the given fully-qualified Service and simple Method names. A config assignment for the specific Method takes precendence over a Service-level assignment.

type GrpcLbConfig

type GrpcLbConfig struct {

	// Optional.  What LB policy to use for routing between the backend
	// addresses.  If unset, defaults to round_robin.
	// Currently, the only supported values are round_robin and pick_first.
	// Note that this will be used both in balancer mode and in fallback mode.
	// Multiple LB policies can be specified; clients will iterate through
	// the list in order and stop at the first policy that they support.
	ChildPolicy []*LoadBalancingConfig `protobuf:"bytes,1,rep,name=child_policy,json=childPolicy,proto3" json:"child_policy,omitempty"`
	// contains filtered or unexported fields
}

Configuration for grpclb LB policy.

func (*GrpcLbConfig) Descriptor deprecated

func (*GrpcLbConfig) Descriptor() ([]byte, []int)

Deprecated: Use GrpcLbConfig.ProtoReflect.Descriptor instead.

func (*GrpcLbConfig) GetChildPolicy

func (x *GrpcLbConfig) GetChildPolicy() []*LoadBalancingConfig

func (*GrpcLbConfig) ProtoMessage

func (*GrpcLbConfig) ProtoMessage()

func (*GrpcLbConfig) ProtoReflect added in v0.14.4

func (x *GrpcLbConfig) ProtoReflect() protoreflect.Message

func (*GrpcLbConfig) Reset

func (x *GrpcLbConfig) Reset()

func (*GrpcLbConfig) String

func (x *GrpcLbConfig) String() string

type LoadBalancingConfig

type LoadBalancingConfig struct {

	// Exactly one LB policy may be configured.
	//
	// Types that are assignable to Policy:
	//
	//	*LoadBalancingConfig_PickFirst
	//	*LoadBalancingConfig_RoundRobin
	//	*LoadBalancingConfig_Xds
	//	*LoadBalancingConfig_Grpclb
	//	*LoadBalancingConfig_XdsExperimental
	Policy isLoadBalancingConfig_Policy `protobuf_oneof:"policy"`
	// contains filtered or unexported fields
}

Selects LB policy and provides corresponding configuration.

In general, all instances of this field should be repeated. Clients will iterate through the list in order and stop at the first policy that they support. This allows the service config to specify custom policies that may not be known to all clients.

func (*LoadBalancingConfig) Descriptor deprecated

func (*LoadBalancingConfig) Descriptor() ([]byte, []int)

Deprecated: Use LoadBalancingConfig.ProtoReflect.Descriptor instead.

func (*LoadBalancingConfig) GetGrpclb

func (x *LoadBalancingConfig) GetGrpclb() *GrpcLbConfig

func (*LoadBalancingConfig) GetPickFirst

func (x *LoadBalancingConfig) GetPickFirst() *PickFirstConfig

func (*LoadBalancingConfig) GetPolicy

func (m *LoadBalancingConfig) GetPolicy() isLoadBalancingConfig_Policy

func (*LoadBalancingConfig) GetRoundRobin

func (x *LoadBalancingConfig) GetRoundRobin() *RoundRobinConfig

func (*LoadBalancingConfig) GetXds

func (x *LoadBalancingConfig) GetXds() *XdsConfig

func (*LoadBalancingConfig) GetXdsExperimental

func (x *LoadBalancingConfig) GetXdsExperimental() *XdsConfig

func (*LoadBalancingConfig) ProtoMessage

func (*LoadBalancingConfig) ProtoMessage()

func (*LoadBalancingConfig) ProtoReflect added in v0.14.4

func (x *LoadBalancingConfig) ProtoReflect() protoreflect.Message

func (*LoadBalancingConfig) Reset

func (x *LoadBalancingConfig) Reset()

func (*LoadBalancingConfig) String

func (x *LoadBalancingConfig) String() string

type LoadBalancingConfig_Grpclb

type LoadBalancingConfig_Grpclb struct {
	Grpclb *GrpcLbConfig `protobuf:"bytes,3,opt,name=grpclb,proto3,oneof"`
}

type LoadBalancingConfig_PickFirst

type LoadBalancingConfig_PickFirst struct {
	// For each new LB policy supported by gRPC, a new field must be added
	// here.  The field's name must be the LB policy name and its type is a
	// message that provides whatever configuration parameters are needed
	// by the LB policy.  The configuration message will be passed to the
	// LB policy when it is instantiated on the client.
	//
	// If the LB policy does not require any configuration parameters, the
	// message for that LB policy may be empty.
	//
	// Note that if an LB policy contains another nested LB policy
	// (e.g., a gslb policy picks the cluster and then delegates to
	// a round_robin policy to pick the backend within that cluster), its
	// configuration message may include a nested instance of the
	// LoadBalancingConfig message to configure the nested LB policy.
	PickFirst *PickFirstConfig `protobuf:"bytes,4,opt,name=pick_first,proto3,oneof"`
}

type LoadBalancingConfig_RoundRobin

type LoadBalancingConfig_RoundRobin struct {
	RoundRobin *RoundRobinConfig `protobuf:"bytes,1,opt,name=round_robin,proto3,oneof"`
}

type LoadBalancingConfig_Xds

type LoadBalancingConfig_Xds struct {
	// xds field should not be used unless people know what they're
	// doing.
	Xds *XdsConfig `protobuf:"bytes,2,opt,name=xds,proto3,oneof"`
}

type LoadBalancingConfig_XdsExperimental

type LoadBalancingConfig_XdsExperimental struct {
	// xds_experimental field should only be used for testing the xds
	// lbpolicy on the gRPC client.
	// TODO(rekarthik): remove this field after xds migration is done.
	XdsExperimental *XdsConfig `protobuf:"bytes,5,opt,name=xds_experimental,proto3,oneof"` // Next available ID: 6
}

type MethodConfig

type MethodConfig struct {
	Name []*MethodConfig_Name `protobuf:"bytes,1,rep,name=name,proto3" json:"name,omitempty"`
	// Whether RPCs sent to this method should wait until the connection is
	// ready by default. If false, the RPC will abort immediately if there is
	// a transient failure connecting to the server. Otherwise, gRPC will
	// attempt to connect until the deadline is exceeded.
	//
	// The value specified via the gRPC client API will override the value
	// set here. However, note that setting the value in the client API will
	// also affect transient errors encountered during name resolution, which
	// cannot be caught by the value here, since the service config is
	// obtained by the gRPC client via name resolution.
	WaitForReady *wrapperspb.BoolValue `protobuf:"bytes,2,opt,name=wait_for_ready,json=waitForReady,proto3" json:"wait_for_ready,omitempty"`
	// The default timeout in seconds for RPCs sent to this method. This can be
	// overridden in code. If no reply is received in the specified amount of
	// time, the request is aborted and a DEADLINE_EXCEEDED error status
	// is returned to the caller.
	//
	// The actual deadline used will be the minimum of the value specified here
	// and the value set by the application via the gRPC client API.  If either
	// one is not set, then the other will be used.  If neither is set, then the
	// request has no deadline.
	Timeout *durationpb.Duration `protobuf:"bytes,3,opt,name=timeout,proto3" json:"timeout,omitempty"`
	// The maximum allowed payload size for an individual request or object in a
	// stream (client->server) in bytes. The size which is measured is the
	// serialized payload after per-message compression (but before stream
	// compression) in bytes. This applies both to streaming and non-streaming
	// requests.
	//
	// The actual value used is the minumum of the value specified here and the
	// value set by the application via the gRPC client API.  If either one is
	// not set, then the other will be used.  If neither is set, then the
	// built-in default is used.
	//
	// If a client attempts to send an object larger than this value, it will not
	// be sent and the client will see a ClientError.
	// Note that 0 is a valid value, meaning that the request message
	// must be empty.
	MaxRequestMessageBytes *wrapperspb.UInt32Value `` /* 131-byte string literal not displayed */
	// The maximum allowed payload size for an individual response or object in a
	// stream (server->client) in bytes. The size which is measured is the
	// serialized payload after per-message compression (but before stream
	// compression) in bytes. This applies both to streaming and non-streaming
	// requests.
	//
	// The actual value used is the minumum of the value specified here and the
	// value set by the application via the gRPC client API.  If either one is
	// not set, then the other will be used.  If neither is set, then the
	// built-in default is used.
	//
	// If a server attempts to send an object larger than this value, it will not
	// be sent, and a ServerError will be sent to the client instead.
	// Note that 0 is a valid value, meaning that the response message
	// must be empty.
	MaxResponseMessageBytes *wrapperspb.UInt32Value `` /* 134-byte string literal not displayed */
	// Only one of retry_policy or hedging_policy may be set. If neither is set,
	// RPCs will not be retried or hedged.
	//
	// Types that are assignable to RetryOrHedgingPolicy:
	//
	//	*MethodConfig_RetryPolicy_
	//	*MethodConfig_HedgingPolicy_
	RetryOrHedgingPolicy isMethodConfig_RetryOrHedgingPolicy `protobuf_oneof:"retry_or_hedging_policy"`
	// contains filtered or unexported fields
}

Configuration for a method.

func (*MethodConfig) Descriptor deprecated

func (*MethodConfig) Descriptor() ([]byte, []int)

Deprecated: Use MethodConfig.ProtoReflect.Descriptor instead.

func (*MethodConfig) GetHedgingPolicy

func (x *MethodConfig) GetHedgingPolicy() *MethodConfig_HedgingPolicy

func (*MethodConfig) GetMaxRequestMessageBytes

func (x *MethodConfig) GetMaxRequestMessageBytes() *wrapperspb.UInt32Value

func (*MethodConfig) GetMaxResponseMessageBytes

func (x *MethodConfig) GetMaxResponseMessageBytes() *wrapperspb.UInt32Value

func (*MethodConfig) GetName

func (x *MethodConfig) GetName() []*MethodConfig_Name

func (*MethodConfig) GetRetryOrHedgingPolicy

func (m *MethodConfig) GetRetryOrHedgingPolicy() isMethodConfig_RetryOrHedgingPolicy

func (*MethodConfig) GetRetryPolicy

func (x *MethodConfig) GetRetryPolicy() *MethodConfig_RetryPolicy

func (*MethodConfig) GetTimeout

func (x *MethodConfig) GetTimeout() *durationpb.Duration

func (*MethodConfig) GetWaitForReady

func (x *MethodConfig) GetWaitForReady() *wrapperspb.BoolValue

func (*MethodConfig) ProtoMessage

func (*MethodConfig) ProtoMessage()

func (*MethodConfig) ProtoReflect added in v0.14.4

func (x *MethodConfig) ProtoReflect() protoreflect.Message

func (*MethodConfig) Reset

func (x *MethodConfig) Reset()

func (*MethodConfig) String

func (x *MethodConfig) String() string

type MethodConfig_HedgingPolicy

type MethodConfig_HedgingPolicy struct {

	// The hedging policy will send up to max_requests RPCs.
	// This number represents the total number of all attempts, including
	// the original attempt.
	//
	// This field is required and must be greater than 1.
	// Any value greater than 5 will be treated as if it were 5.
	MaxAttempts uint32 `protobuf:"varint,1,opt,name=max_attempts,json=maxAttempts,proto3" json:"max_attempts,omitempty"`
	// The first RPC will be sent immediately, but the max_requests-1 subsequent
	// hedged RPCs will be sent at intervals of every hedging_delay. Set this
	// to 0 to immediately send all max_requests RPCs.
	HedgingDelay *durationpb.Duration `protobuf:"bytes,2,opt,name=hedging_delay,json=hedgingDelay,proto3" json:"hedging_delay,omitempty"`
	// The set of status codes which indicate other hedged RPCs may still
	// succeed. If a non-fatal status code is returned by the server, hedged
	// RPCs will continue. Otherwise, outstanding requests will be canceled and
	// the error returned to the client application layer.
	//
	// This field is optional.
	NonFatalStatusCodes []code.Code `` /* 151-byte string literal not displayed */
	// contains filtered or unexported fields
}

The hedging policy for outgoing RPCs. Hedged RPCs may execute more than once on the server, so only idempotent methods should specify a hedging policy.

func (*MethodConfig_HedgingPolicy) Descriptor deprecated

func (*MethodConfig_HedgingPolicy) Descriptor() ([]byte, []int)

Deprecated: Use MethodConfig_HedgingPolicy.ProtoReflect.Descriptor instead.

func (*MethodConfig_HedgingPolicy) GetHedgingDelay

func (x *MethodConfig_HedgingPolicy) GetHedgingDelay() *durationpb.Duration

func (*MethodConfig_HedgingPolicy) GetMaxAttempts

func (x *MethodConfig_HedgingPolicy) GetMaxAttempts() uint32

func (*MethodConfig_HedgingPolicy) GetNonFatalStatusCodes

func (x *MethodConfig_HedgingPolicy) GetNonFatalStatusCodes() []code.Code

func (*MethodConfig_HedgingPolicy) ProtoMessage

func (*MethodConfig_HedgingPolicy) ProtoMessage()

func (*MethodConfig_HedgingPolicy) ProtoReflect added in v0.14.4

func (*MethodConfig_HedgingPolicy) Reset

func (x *MethodConfig_HedgingPolicy) Reset()

func (*MethodConfig_HedgingPolicy) String

func (x *MethodConfig_HedgingPolicy) String() string

type MethodConfig_HedgingPolicy_

type MethodConfig_HedgingPolicy_ struct {
	HedgingPolicy *MethodConfig_HedgingPolicy `protobuf:"bytes,7,opt,name=hedging_policy,json=hedgingPolicy,proto3,oneof"`
}

type MethodConfig_Name

type MethodConfig_Name struct {
	Service string `protobuf:"bytes,1,opt,name=service,proto3" json:"service,omitempty"` // Required. Includes proto package name.
	Method  string `protobuf:"bytes,2,opt,name=method,proto3" json:"method,omitempty"`
	// contains filtered or unexported fields
}

The names of the methods to which this configuration applies. There must be at least one name. Each name entry must be unique across the entire ClientConfig. If the 'method' field is empty, then this MethodConfig specifies the defaults for all methods for the specified service.

For example, let's say that the service config contains the following MethodConfig entries:

method_config { name { service: "MyService" } ... } method_config { name { service: "MyService" method: "Foo" } ... }

For a request for MyService/Foo, we will use the second entry, because it exactly matches the service and method name. For a request for MyService/Bar, we will use the first entry, because it provides the default for all methods of MyService.

func (*MethodConfig_Name) Descriptor deprecated

func (*MethodConfig_Name) Descriptor() ([]byte, []int)

Deprecated: Use MethodConfig_Name.ProtoReflect.Descriptor instead.

func (*MethodConfig_Name) GetMethod

func (x *MethodConfig_Name) GetMethod() string

func (*MethodConfig_Name) GetService

func (x *MethodConfig_Name) GetService() string

func (*MethodConfig_Name) ProtoMessage

func (*MethodConfig_Name) ProtoMessage()

func (*MethodConfig_Name) ProtoReflect added in v0.14.4

func (x *MethodConfig_Name) ProtoReflect() protoreflect.Message

func (*MethodConfig_Name) Reset

func (x *MethodConfig_Name) Reset()

func (*MethodConfig_Name) String

func (x *MethodConfig_Name) String() string

type MethodConfig_RetryPolicy

type MethodConfig_RetryPolicy struct {

	// The maximum number of RPC attempts, including the original attempt.
	//
	// This field is required and must be greater than 1.
	// Any value greater than 5 will be treated as if it were 5.
	MaxAttempts uint32 `protobuf:"varint,1,opt,name=max_attempts,json=maxAttempts,proto3" json:"max_attempts,omitempty"`
	// Exponential backoff parameters. The initial retry attempt will occur at
	// random(0, initial_backoff). In general, the nth attempt will occur at
	// random(0,
	//
	//	min(initial_backoff*backoff_multiplier**(n-1), max_backoff)).
	//
	// Required. Must be greater than zero.
	InitialBackoff *durationpb.Duration `protobuf:"bytes,2,opt,name=initial_backoff,json=initialBackoff,proto3" json:"initial_backoff,omitempty"`
	// Required. Must be greater than zero.
	MaxBackoff        *durationpb.Duration `protobuf:"bytes,3,opt,name=max_backoff,json=maxBackoff,proto3" json:"max_backoff,omitempty"`
	BackoffMultiplier float32              `protobuf:"fixed32,4,opt,name=backoff_multiplier,json=backoffMultiplier,proto3" json:"backoff_multiplier,omitempty"` // Required. Must be greater than zero.
	// The set of status codes which may be retried.
	//
	// This field is required and must be non-empty.
	RetryableStatusCodes []code.Code `` /* 152-byte string literal not displayed */
	// contains filtered or unexported fields
}

The retry policy for outgoing RPCs.

func (*MethodConfig_RetryPolicy) Descriptor deprecated

func (*MethodConfig_RetryPolicy) Descriptor() ([]byte, []int)

Deprecated: Use MethodConfig_RetryPolicy.ProtoReflect.Descriptor instead.

func (*MethodConfig_RetryPolicy) GetBackoffMultiplier

func (x *MethodConfig_RetryPolicy) GetBackoffMultiplier() float32

func (*MethodConfig_RetryPolicy) GetInitialBackoff

func (x *MethodConfig_RetryPolicy) GetInitialBackoff() *durationpb.Duration

func (*MethodConfig_RetryPolicy) GetMaxAttempts

func (x *MethodConfig_RetryPolicy) GetMaxAttempts() uint32

func (*MethodConfig_RetryPolicy) GetMaxBackoff

func (x *MethodConfig_RetryPolicy) GetMaxBackoff() *durationpb.Duration

func (*MethodConfig_RetryPolicy) GetRetryableStatusCodes

func (x *MethodConfig_RetryPolicy) GetRetryableStatusCodes() []code.Code

func (*MethodConfig_RetryPolicy) ProtoMessage

func (*MethodConfig_RetryPolicy) ProtoMessage()

func (*MethodConfig_RetryPolicy) ProtoReflect added in v0.14.4

func (x *MethodConfig_RetryPolicy) ProtoReflect() protoreflect.Message

func (*MethodConfig_RetryPolicy) Reset

func (x *MethodConfig_RetryPolicy) Reset()

func (*MethodConfig_RetryPolicy) String

func (x *MethodConfig_RetryPolicy) String() string

type MethodConfig_RetryPolicy_

type MethodConfig_RetryPolicy_ struct {
	RetryPolicy *MethodConfig_RetryPolicy `protobuf:"bytes,6,opt,name=retry_policy,json=retryPolicy,proto3,oneof"`
}

type PickFirstConfig

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

Configuration for pick_first LB policy.

func (*PickFirstConfig) Descriptor deprecated

func (*PickFirstConfig) Descriptor() ([]byte, []int)

Deprecated: Use PickFirstConfig.ProtoReflect.Descriptor instead.

func (*PickFirstConfig) ProtoMessage

func (*PickFirstConfig) ProtoMessage()

func (*PickFirstConfig) ProtoReflect added in v0.14.4

func (x *PickFirstConfig) ProtoReflect() protoreflect.Message

func (*PickFirstConfig) Reset

func (x *PickFirstConfig) Reset()

func (*PickFirstConfig) String

func (x *PickFirstConfig) String() string

type RoundRobinConfig

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

Configuration for round_robin LB policy.

func (*RoundRobinConfig) Descriptor deprecated

func (*RoundRobinConfig) Descriptor() ([]byte, []int)

Deprecated: Use RoundRobinConfig.ProtoReflect.Descriptor instead.

func (*RoundRobinConfig) ProtoMessage

func (*RoundRobinConfig) ProtoMessage()

func (*RoundRobinConfig) ProtoReflect added in v0.14.4

func (x *RoundRobinConfig) ProtoReflect() protoreflect.Message

func (*RoundRobinConfig) Reset

func (x *RoundRobinConfig) Reset()

func (*RoundRobinConfig) String

func (x *RoundRobinConfig) String() string

type ServiceConfig

type ServiceConfig struct {

	// Deprecated: Marked as deprecated in grpc_service_config.proto.
	LoadBalancingPolicy ServiceConfig_LoadBalancingPolicy `` /* 184-byte string literal not displayed */
	// Multiple LB policies can be specified; clients will iterate through
	// the list in order and stop at the first policy that they support. If none
	// are supported, the service config is considered invalid.
	LoadBalancingConfig []*LoadBalancingConfig `protobuf:"bytes,4,rep,name=load_balancing_config,json=loadBalancingConfig,proto3" json:"load_balancing_config,omitempty"`
	// Per-method configuration.
	MethodConfig      []*MethodConfig                      `protobuf:"bytes,2,rep,name=method_config,json=methodConfig,proto3" json:"method_config,omitempty"`
	RetryThrottling   *ServiceConfig_RetryThrottlingPolicy `protobuf:"bytes,3,opt,name=retry_throttling,json=retryThrottling,proto3" json:"retry_throttling,omitempty"`
	HealthCheckConfig *ServiceConfig_HealthCheckConfig     `protobuf:"bytes,5,opt,name=health_check_config,json=healthCheckConfig,proto3" json:"health_check_config,omitempty"`
	// contains filtered or unexported fields
}

A ServiceConfig represents information about a service but is not specific to any name resolver.

func (*ServiceConfig) Descriptor deprecated

func (*ServiceConfig) Descriptor() ([]byte, []int)

Deprecated: Use ServiceConfig.ProtoReflect.Descriptor instead.

func (*ServiceConfig) GetHealthCheckConfig

func (x *ServiceConfig) GetHealthCheckConfig() *ServiceConfig_HealthCheckConfig

func (*ServiceConfig) GetLoadBalancingConfig

func (x *ServiceConfig) GetLoadBalancingConfig() []*LoadBalancingConfig

func (*ServiceConfig) GetLoadBalancingPolicy deprecated

func (x *ServiceConfig) GetLoadBalancingPolicy() ServiceConfig_LoadBalancingPolicy

Deprecated: Marked as deprecated in grpc_service_config.proto.

func (*ServiceConfig) GetMethodConfig

func (x *ServiceConfig) GetMethodConfig() []*MethodConfig

func (*ServiceConfig) GetRetryThrottling

func (x *ServiceConfig) GetRetryThrottling() *ServiceConfig_RetryThrottlingPolicy

func (*ServiceConfig) ProtoMessage

func (*ServiceConfig) ProtoMessage()

func (*ServiceConfig) ProtoReflect added in v0.14.4

func (x *ServiceConfig) ProtoReflect() protoreflect.Message

func (*ServiceConfig) Reset

func (x *ServiceConfig) Reset()

func (*ServiceConfig) String

func (x *ServiceConfig) String() string

type ServiceConfig_HealthCheckConfig

type ServiceConfig_HealthCheckConfig struct {

	// Service name to use in the health-checking request.
	ServiceName *wrapperspb.StringValue `protobuf:"bytes,1,opt,name=service_name,json=serviceName,proto3" json:"service_name,omitempty"`
	// contains filtered or unexported fields
}

func (*ServiceConfig_HealthCheckConfig) Descriptor deprecated

func (*ServiceConfig_HealthCheckConfig) Descriptor() ([]byte, []int)

Deprecated: Use ServiceConfig_HealthCheckConfig.ProtoReflect.Descriptor instead.

func (*ServiceConfig_HealthCheckConfig) GetServiceName

func (*ServiceConfig_HealthCheckConfig) ProtoMessage

func (*ServiceConfig_HealthCheckConfig) ProtoMessage()

func (*ServiceConfig_HealthCheckConfig) ProtoReflect added in v0.14.4

func (*ServiceConfig_HealthCheckConfig) Reset

func (*ServiceConfig_HealthCheckConfig) String

type ServiceConfig_LoadBalancingPolicy

type ServiceConfig_LoadBalancingPolicy int32

Load balancing policy.

Note that load_balancing_policy is deprecated in favor of load_balancing_config; the former will be used only if the latter is unset.

If no LB policy is configured here, then the default is pick_first. If the policy name is set via the client API, that value overrides the value specified here.

If the deprecated load_balancing_policy field is used, note that if the resolver returns at least one balancer address (as opposed to backend addresses), gRPC will use grpclb (see https://github.com/grpc/grpc/blob/master/doc/load-balancing.md), regardless of what policy is configured here. However, if the resolver returns at least one backend address in addition to the balancer address(es), the client may fall back to the requested policy if it is unable to reach any of the grpclb load balancers.

const (
	ServiceConfig_UNSPECIFIED ServiceConfig_LoadBalancingPolicy = 0
	ServiceConfig_ROUND_ROBIN ServiceConfig_LoadBalancingPolicy = 1
)

func (ServiceConfig_LoadBalancingPolicy) Descriptor added in v0.14.4

func (ServiceConfig_LoadBalancingPolicy) Enum added in v0.14.4

func (ServiceConfig_LoadBalancingPolicy) EnumDescriptor deprecated

func (ServiceConfig_LoadBalancingPolicy) EnumDescriptor() ([]byte, []int)

Deprecated: Use ServiceConfig_LoadBalancingPolicy.Descriptor instead.

func (ServiceConfig_LoadBalancingPolicy) Number added in v0.14.4

func (ServiceConfig_LoadBalancingPolicy) String

func (ServiceConfig_LoadBalancingPolicy) Type added in v0.14.4

type ServiceConfig_RetryThrottlingPolicy

type ServiceConfig_RetryThrottlingPolicy struct {

	// The number of tokens starts at max_tokens. The token_count will always be
	// between 0 and max_tokens.
	//
	// This field is required and must be greater than zero.
	MaxTokens uint32 `protobuf:"varint,1,opt,name=max_tokens,json=maxTokens,proto3" json:"max_tokens,omitempty"`
	// The amount of tokens to add on each successful RPC. Typically this will
	// be some number between 0 and 1, e.g., 0.1.
	//
	// This field is required and must be greater than zero. Up to 3 decimal
	// places are supported.
	TokenRatio float32 `protobuf:"fixed32,2,opt,name=token_ratio,json=tokenRatio,proto3" json:"token_ratio,omitempty"`
	// contains filtered or unexported fields
}

If a RetryThrottlingPolicy is provided, gRPC will automatically throttle retry attempts and hedged RPCs when the client's ratio of failures to successes exceeds a threshold.

For each server name, the gRPC client will maintain a token_count which is initially set to max_tokens. Every outgoing RPC (regardless of service or method invoked) will change token_count as follows:

  • Every failed RPC will decrement the token_count by 1.
  • Every successful RPC will increment the token_count by token_ratio.

If token_count is less than or equal to max_tokens / 2, then RPCs will not be retried and hedged RPCs will not be sent.

func (*ServiceConfig_RetryThrottlingPolicy) Descriptor deprecated

func (*ServiceConfig_RetryThrottlingPolicy) Descriptor() ([]byte, []int)

Deprecated: Use ServiceConfig_RetryThrottlingPolicy.ProtoReflect.Descriptor instead.

func (*ServiceConfig_RetryThrottlingPolicy) GetMaxTokens

func (x *ServiceConfig_RetryThrottlingPolicy) GetMaxTokens() uint32

func (*ServiceConfig_RetryThrottlingPolicy) GetTokenRatio

func (x *ServiceConfig_RetryThrottlingPolicy) GetTokenRatio() float32

func (*ServiceConfig_RetryThrottlingPolicy) ProtoMessage

func (*ServiceConfig_RetryThrottlingPolicy) ProtoMessage()

func (*ServiceConfig_RetryThrottlingPolicy) ProtoReflect added in v0.14.4

func (*ServiceConfig_RetryThrottlingPolicy) Reset

func (*ServiceConfig_RetryThrottlingPolicy) String

type XdsConfig

type XdsConfig struct {

	// Required.  Name of balancer to connect to.
	BalancerName string `protobuf:"bytes,1,opt,name=balancer_name,json=balancerName,proto3" json:"balancer_name,omitempty"`
	// Optional.  What LB policy to use for intra-locality routing.
	// If unset, will use whatever algorithm is specified by the balancer.
	// Multiple LB policies can be specified; clients will iterate through
	// the list in order and stop at the first policy that they support.
	ChildPolicy []*LoadBalancingConfig `protobuf:"bytes,2,rep,name=child_policy,json=childPolicy,proto3" json:"child_policy,omitempty"`
	// Optional.  What LB policy to use in fallback mode.  If not
	// specified, defaults to round_robin.
	// Multiple LB policies can be specified; clients will iterate through
	// the list in order and stop at the first policy that they support.
	FallbackPolicy []*LoadBalancingConfig `protobuf:"bytes,3,rep,name=fallback_policy,json=fallbackPolicy,proto3" json:"fallback_policy,omitempty"`
	// contains filtered or unexported fields
}

Configuration for xds LB policy.

func (*XdsConfig) Descriptor deprecated

func (*XdsConfig) Descriptor() ([]byte, []int)

Deprecated: Use XdsConfig.ProtoReflect.Descriptor instead.

func (*XdsConfig) GetBalancerName

func (x *XdsConfig) GetBalancerName() string

func (*XdsConfig) GetChildPolicy

func (x *XdsConfig) GetChildPolicy() []*LoadBalancingConfig

func (*XdsConfig) GetFallbackPolicy

func (x *XdsConfig) GetFallbackPolicy() []*LoadBalancingConfig

func (*XdsConfig) ProtoMessage

func (*XdsConfig) ProtoMessage()

func (*XdsConfig) ProtoReflect added in v0.14.4

func (x *XdsConfig) ProtoReflect() protoreflect.Message

func (*XdsConfig) Reset

func (x *XdsConfig) Reset()

func (*XdsConfig) String

func (x *XdsConfig) String() string

Jump to

Keyboard shortcuts

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