client

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewClientConn

func NewClientConn(target string, opts ...options.Option[clientOptions]) (*grpc.ClientConn, error)

func NewClientConnContext

func NewClientConnContext(ctx context.Context, target string, opts ...options.Option[clientOptions]) (*grpc.ClientConn, error)

func NewClientOptions added in v0.0.4

func NewClientOptions(opts ...options.Option[clientOptions]) (*[]grpc.DialOption, error)

func WithClientTracing added in v0.0.4

func WithClientTracing(tp *sdktrace.TracerProvider) options.Option[clientOptions]

func WithClientValidator added in v0.0.4

func WithClientValidator(all bool) options.Option[clientOptions]

WithClientValidator validate fields, all==true return all fields error, otherwise return first error

func WithEtcdDiscovery added in v0.0.4

func WithEtcdDiscovery(conf clientv3.Config, serviceDesc grpc.ServiceDesc) options.Option[clientOptions]

func WithInsecure added in v0.0.4

func WithInsecure() options.Option[clientOptions]

func WithRRLB added in v0.0.4

func WithRRLB() options.Option[clientOptions]

round_robin load balancing policy

func WithRetry added in v0.0.4

func WithRetry(mc ...MethodConfig) options.Option[clientOptions]

Types

type MethodConfig added in v0.0.4

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

type MethodName added in v0.0.4

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

type RetryPolicy added in v0.0.4

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

type ServiceConfig added in v0.0.4

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