Versions in this module Expand all Collapse all v0 v0.4.1 May 13, 2026 Changes in this version + var ErrNoPeers = errors.New("clienthttp: no peers discovered") + func NewClient(serviceType string, opts ...Option) (*http.Client, func(), error) + type AuthAttacher interface + Attach func(req *http.Request, peer Peer) error + type BearerAttacher struct + Bearer string + func (a BearerAttacher) Attach(req *http.Request, _ Peer) error + type Dialer interface + Dial func(ctx context.Context, peer Peer) (http.RoundTripper, error) + type Discovery interface + PeerCount func() int + Peers func() []Peer + ServiceType func() string + Start func() error + Stop func() + type NoAuthAttacher struct + func (NoAuthAttacher) Attach(*http.Request, Peer) error + type Option func(*Options) + func WithAuthAttacher(a AuthAttacher) Option + func WithBearer(b string) Option + func WithBrowseInterval(d time.Duration) Option + func WithClientID(id string) Option + func WithDialer(d Dialer) Option + func WithDiscoverTimeout(d time.Duration) Option + func WithDiscovery(d Discovery) Option + func WithHTTPTimeout(d time.Duration) Option + func WithLocalTrust() Option + func WithMinPeers(n int) Option + func WithPicker(p Picker) Option + type Options struct + Auth AuthAttacher + Bearer string + BrowseInterval time.Duration + ClientID string + Dialer Dialer + DiscoverTimeout time.Duration + Discovery Discovery + HTTPTimeout time.Duration + MinPeers int + Picker Picker + type Peer struct + Address string + LastSeen time.Time + Metadata map[string]string + NodeID string + ServiceType string + type Picker interface + Pick func(peers []Peer) (Peer, error) + type RoundRobinPicker struct + func (p *RoundRobinPicker) Pick(peers []Peer) (Peer, error) + type ZAPHTTPDialer struct + func NewZAPHTTPDialer() *ZAPHTTPDialer + func (d *ZAPHTTPDialer) Dial(_ context.Context, peer Peer) (http.RoundTripper, error)