consul

package
v0.0.45 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DataEmptyError = "data find empty"
)

Variables

This section is empty.

Functions

func DiscoveryServices added in v0.0.41

func DiscoveryServices(serviceName string, q *consul.QueryOptions) ([]consul.AgentServiceChecksInfo, error)

func InitConsulClient

func InitConsulClient()

func RegisterGrpcConsul

func RegisterGrpcConsul(serviceStruct ServiceConsul) error

func RegisterWebConsul

func RegisterWebConsul(serviceStruct ServiceConsul) error

func UnRegisterConsul

func UnRegisterConsul(serviceId string)

Types

type Resolver

type Resolver struct {
	// contains filtered or unexported fields
}

Resolver for grpc client

func NewResolver

func NewResolver(serviceName string, logger *zap.Logger) *Resolver

NewResolver create a new resolver.Builder base on etcd

func (*Resolver) Build

Build creates a new resolver.Resolver for the given target

func (*Resolver) Close

func (r *Resolver) Close()

Close resolver.Resolver interface

func (*Resolver) ResolveNow

func (r *Resolver) ResolveNow(o resolver.ResolveNowOptions)

ResolveNow resolver.Resolver interface

func (*Resolver) Scheme

func (r *Resolver) Scheme() string

Scheme returns the scheme supported by this resolver.

type ServiceConsul

type ServiceConsul struct {
	Id       string
	Name     string
	Port     int
	Address  string
	IsSecure bool
}

Jump to

Keyboard shortcuts

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