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 ¶
func GetLocalIP ¶ added in v1.2.7
GetLocalIP get the IP address of the current system
physical or virtual machine
Types ¶
type Discovery ¶ added in v1.2.7
type Discovery struct {
// contains filtered or unexported fields
}
func NewDiscovery ¶ added in v1.2.7
func (*Discovery) Build ¶ added in v1.2.7
func (d *Discovery) Build(target resolver.Target, cc resolver.ClientConn, opts resolver.BuildOptions) (resolver.Resolver, error)
func (*Discovery) DelDiscoveryServiceList ¶ added in v1.2.7
func (*Discovery) DelServiceList ¶ added in v1.2.7
func (*Discovery) ResolveNow ¶ added in v1.2.7
func (d *Discovery) ResolveNow(options resolver.ResolveNowOptions)
func (*Discovery) SetDiscoveryServiceList ¶ added in v1.2.7
func (*Discovery) SetServiceList ¶ added in v1.2.7
type GrpcClient ¶ added in v1.2.7
type GrpcClient struct {
// contains filtered or unexported fields
}
func NewGrpcClient ¶ added in v1.2.7
func NewGrpcClient(opt *GrpcClientOption) (*GrpcClient, error)
func (*GrpcClient) GetConn ¶ added in v1.2.7
func (c *GrpcClient) GetConn() (*grpc.ClientConn, context.Context, error)
GetConn returns grpc clientConn,ctx and error
type GrpcClientOption ¶ added in v1.2.7
type GrpcServer ¶ added in v1.2.7
type GrpcServer struct { Listener net.Listener Server *grpc.Server ServerName string // contains filtered or unexported fields }
func NewGrpcServer ¶ added in v1.2.7
func NewGrpcServer(opt *GrpcServerOption) (*GrpcServer, error)
NewGrpcServer 返回新的grpc register
type GrpcServerOption ¶ added in v1.2.7
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 ¶ added in v1.2.7
type Register struct {
// contains filtered or unexported fields
}
func NewRegister ¶ added in v1.2.7
func NewRegister(opt *RegisterOption) (*Register, error)
func (*Register) ListenLeaseRespChan ¶ added in v1.2.7
func (s *Register) ListenLeaseRespChan()
Click to show internal directories.
Click to hide internal directories.