Documentation
¶
Index ¶
- func NewInstance(netAddr net.Addr, weight int) discovery.Instance
- func NewNetAddr(network, address string) net.Addr
- func NewP2PResolver(network, target string) discovery.Resolver
- type Instance
- type NetAddr
- type P2PResolver
- func (p *P2PResolver) Diff(cacheKey string, prev discovery.Result, next discovery.Result) (discovery.Change, bool)
- func (p *P2PResolver) Name() string
- func (p *P2PResolver) Resolve(ctx context.Context, desc string) (discovery.Result, error)
- func (p *P2PResolver) Target(ctx context.Context, target rpcinfo.EndpointInfo) (description string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewNetAddr ¶
func NewP2PResolver ¶
Types ¶
type P2PResolver ¶
type P2PResolver struct {
// contains filtered or unexported fields
}
func (*P2PResolver) Diff ¶
func (p *P2PResolver) Diff(cacheKey string, prev discovery.Result, next discovery.Result) (discovery.Change, bool)
Diff computes the difference between two results. When `next` is cacheable, the Change should be cacheable, too. And the `Result` field's CacheKey in the return value should be set with the given cacheKey.
func (*P2PResolver) Name ¶
func (p *P2PResolver) Name() string
Name returns the name of the resolver.
func (*P2PResolver) Target ¶
func (p *P2PResolver) Target(ctx context.Context, target rpcinfo.EndpointInfo) (description string)
Target should return a description for the given target that is suitable for being a key for cache.
Click to show internal directories.
Click to hide internal directories.