util

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2025 License: MIT Imports: 5 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Advertise(ctx context.Context, a discovery.Advertiser, ns string, opts ...discovery.Option)

Advertise 持续通过广告者发布服务 参数:

  • ctx: context.Context 上下文
  • a: discovery.Advertiser 广告者接口
  • ns: string 命名空间
  • opts: ...discovery.Option 可选的配置选项

func FindPeers

func FindPeers(ctx context.Context, d discovery.Discoverer, ns string, opts ...discovery.Option) ([]peer.AddrInfo, error)

FindPeers 同步从发现者收集对等节点信息 参数:

  • ctx: context.Context 上下文
  • d: discovery.Discoverer 发现者接口
  • ns: string 命名空间
  • opts: ...discovery.Option 可选的配置选项

返回值:

  • []peer.AddrInfo: 返回收集到的节点信息列表
  • error: 如果发生错误则返回错误信息

Types

This section is empty.

Jump to

Keyboard shortcuts

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