Documentation ¶
Index ¶
- Variables
- func Init()
- func Register(svcName string, port int)
- type ConsulInstance
- type ConsulResolver
- func (r *ConsulResolver) Diff(cacheKey string, prev, next discovery.Result) (discovery.Change, bool)
- func (r *ConsulResolver) Name() string
- func (r *ConsulResolver) Resolve(ctx context.Context, desc string) (discovery.Result, error)
- func (r *ConsulResolver) Target(ctx context.Context, target rpcinfo.EndpointInfo) (description string)
Constants ¶
This section is empty.
Variables ¶
View Source
var Client *consulapi.Client
Functions ¶
Types ¶
type ConsulInstance ¶
type ConsulInstance struct {
// contains filtered or unexported fields
}
func (*ConsulInstance) Address ¶
func (i *ConsulInstance) Address() net.Addr
func (*ConsulInstance) Weight ¶
func (i *ConsulInstance) Weight() int
type ConsulResolver ¶
func (*ConsulResolver) Diff ¶
func (r *ConsulResolver) Diff(cacheKey string, prev, 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 (*ConsulResolver) Name ¶
func (r *ConsulResolver) Name() string
Name returns the name of the resolver.
func (*ConsulResolver) Resolve ¶
Resolve returns a list of instances for the given description of a target.
func (*ConsulResolver) Target ¶
func (r *ConsulResolver) Target(ctx context.Context, target rpcinfo.EndpointInfo) (description string)
Click to show internal directories.
Click to hide internal directories.