options

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2022 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewClientOptions

func NewClientOptions(opts ...ClientOption) (*[]grpc.DialOption, error)

func NewServerOptions

func NewServerOptions(opts ...ServerOption) []grpc.UnaryServerInterceptor

Types

type ClientOption

type ClientOption interface {
	// contains filtered or unexported methods
}

func WithClientTracing

func WithClientTracing(tp *sdktrace.TracerProvider) ClientOption

func WithEtcdDiscovery

func WithEtcdDiscovery(conf clientv3.Config, serviceDesc grpc.ServiceDesc) ClientOption

func WithInsecure

func WithInsecure() ClientOption

func WithRRLB

func WithRRLB() ClientOption

round_robin load balancing policy

func WithRetry

func WithRetry(mc ...MethodConfig) ClientOption

type MethodConfig

type MethodConfig struct {
	Name        []MethodName `json:"name"`
	RetryPolicy RetryPolicy  `json:"retryPolicy"`
}

type MethodName

type MethodName struct {
	Service string `json:"service"`
	Method  string `json:"method"`
}

type RetryPolicy

type RetryPolicy struct {
	MaxAttempts          int      `json:"MaxAttempts"`
	MaxBackoff           string   `json:"MaxBackoff"`
	InitialBackoff       string   `json:"InitialBackoff"`
	BackoffMultiplier    int      `json:"BackoffMultiplier"`
	RetryableStatusCodes []string `json:"RetryableStatusCodes"`
}

type ServerOption

type ServerOption interface {
	// contains filtered or unexported methods
}

func WithDebug

func WithDebug(flag bool) ServerOption

func WithServerTracing

func WithServerTracing(tp *sdktrace.TracerProvider) ServerOption

func WithTBRL

func WithTBRL(pairs ...ratelimit.TBPair) ServerOption

WithTBRL TokenBucketRateLimiter

type ServiceConfig

type ServiceConfig struct {
	Methodconfig        []MethodConfig `json:"methodConfig,omitempty"`
	LoadBalancingPolicy string         `json:"loadBalancingPolicy,omitempty"`
}

Jump to

Keyboard shortcuts

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