Documentation ¶
Index ¶
- func GetLocalIP() (string, error)
- type ConnType
- type Discovery
- func (d *Discovery) Build(target resolver.Target, cc resolver.ClientConn, opts resolver.BuildOptions) (resolver.Resolver, error)
- func (d *Discovery) Builder() error
- func (d *Discovery) Close()
- func (d *Discovery) DelDiscoveryServiceList(key string)
- func (d *Discovery) DelServiceList(key string)
- func (d *Discovery) GetValues() []string
- func (d *Discovery) ResolveNow(options resolver.ResolveNowOptions)
- func (d *Discovery) Scheme() string
- func (d *Discovery) SetDiscoveryServiceList(key, val string)
- func (d *Discovery) SetServiceList(key, val string)
- type GrpcClient
- type GrpcClientOption
- type GrpcServer
- type GrpcServerOption
- type Register
- type RegisterOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Discovery ¶
type Discovery struct {
// contains filtered or unexported fields
}
func NewDiscovery ¶
func (*Discovery) Build ¶
func (d *Discovery) Build(target resolver.Target, cc resolver.ClientConn, opts resolver.BuildOptions) (resolver.Resolver, error)
func (*Discovery) DelDiscoveryServiceList ¶
func (*Discovery) DelServiceList ¶
func (*Discovery) ResolveNow ¶
func (d *Discovery) ResolveNow(options resolver.ResolveNowOptions)
func (*Discovery) SetDiscoveryServiceList ¶
func (*Discovery) SetServiceList ¶
type GrpcClient ¶
type GrpcClient struct {
// contains filtered or unexported fields
}
func NewGrpcClient ¶
func NewGrpcClient(opt *GrpcClientOption) (*GrpcClient, error)
func (*GrpcClient) GetConn ¶
func (c *GrpcClient) GetConn() (*grpc.ClientConn, context.Context, error)
GetConn returns grpc clientConn,ctx and error
type GrpcClientOption ¶
type GrpcServer ¶
type GrpcServer struct { Listener net.Listener Server *grpc.Server ServerName string // contains filtered or unexported fields }
func NewGrpcServer ¶
func NewGrpcServer(opt *GrpcServerOption) (*GrpcServer, error)
NewGrpcServer 返回新的grpc register
type GrpcServerOption ¶
type GrpcServerOption struct { // grpc ServerName 服务名 ServerName string // 端口 Port int // IP地址 IP string // EtcdEndpoints etcd地址,如果为多个地址时,需要集群部署etcd EtcdEndpoints []string // Lease etcd 租约续期时间 Lease int64 // IsRegister 是否注册到etcd // 为true时,可不填写传入ip地址 IsRegister bool }
GrpcServerOption grpc register 参数
type Register ¶
type Register struct {
// contains filtered or unexported fields
}
func NewRegister ¶
func NewRegister(opt *RegisterOption) (*Register, error)
func (*Register) ListenLeaseRespChan ¶
func (s *Register) ListenLeaseRespChan()
Click to show internal directories.
Click to hide internal directories.