sd

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2022 License: Apache-2.0 Imports: 9 Imported by: 32

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Discovery

func Discovery(resolver discovery.Resolver, opts ...ServiceDiscoveryOption) func(next client.Endpoint) client.Endpoint

Discovery will construct a middleware with BalancerFactory.

Types

type ServiceDiscoveryOption

type ServiceDiscoveryOption struct {
	F func(o *ServiceDiscoveryOptions)
}

func WithCustomizedAddrs

func WithCustomizedAddrs(addrs ...string) ServiceDiscoveryOption

WithCustomizedAddrs specifies the target instance addresses when doing service discovery. It overwrites the results from the Resolver

func WithLoadBalanceOptions

func WithLoadBalanceOptions(lb loadbalance.Loadbalancer, options loadbalance.Options) ServiceDiscoveryOption

WithLoadBalanceOptions sets Loadbalancer and loadbalance options for hertz client

type ServiceDiscoveryOptions

type ServiceDiscoveryOptions struct {
	// Resolver is used to client discovery
	Resolver discovery.Resolver

	// Balancer is used to client load balance
	Balancer loadbalance.Loadbalancer

	// LbOpts LoadBalance option
	LbOpts loadbalance.Options
}

ServiceDiscoveryOptions service discovery option for client

func (*ServiceDiscoveryOptions) Apply

Jump to

Keyboard shortcuts

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