sd

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Discovery

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

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