Documentation ¶
Index ¶
- func NewEtcdClientConn(address string, port int, serviceName string, timeout int) (*grpc.ClientConn, error)
- func NewEtcdHTTPClient(address string, port int, serviceName string, timeout int) (*httputil.ServiceClient, error)
- type Balancer
- type ServiceMesh
- type ServiceMeshEtcdImpl
- func (s *ServiceMeshEtcdImpl) DeRegService(projectName string, projectVersion string, serviceIP string, servicePort int, ...) error
- func (s *ServiceMeshEtcdImpl) GetClient() interface{}
- func (s *ServiceMeshEtcdImpl) RegService(projectName string, projectVersion string, serviceIP string, servicePort int, ...) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewEtcdClientConn ¶
func NewEtcdClientConn(address string, port int, serviceName string, timeout int) (*grpc.ClientConn, error)
NewEtcdClientConn new etcd client connection for grpc
func NewEtcdHTTPClient ¶ added in v0.0.35
func NewEtcdHTTPClient(address string, port int, serviceName string, timeout int) (*httputil.ServiceClient, error)
NewEtcdHTTPClient new etcd http client
Types ¶
type Balancer ¶ added in v0.0.35
type Balancer interface {
Client() (*httputil.ServiceClient, error)
}
Balancer balancer
func NewRoundRobin ¶ added in v0.0.35
func NewRoundRobin(s []httputil.ServiceClient) Balancer
NewRoundRobin returns a load balancer that returns services in sequence.
type ServiceMesh ¶
type ServiceMesh interface { GetClient() interface{} RegService(projectName string, projectVersion string, serviceIP string, servicePort int, Tags []string, timeout int) error DeRegService(projectName string, projectVersion string, serviceIP string, servicePort int, timeout int) error }
ServiceMesh interface
func NewEtcdRegister ¶
func NewEtcdRegister(address string, port int) (ServiceMesh, error)
NewEtcdRegister New consul register
type ServiceMeshEtcdImpl ¶
type ServiceMeshEtcdImpl struct { // config Address string // consul address Port int // contains filtered or unexported fields }
ServiceMeshEtcdImpl consul register
func (*ServiceMeshEtcdImpl) DeRegService ¶
func (s *ServiceMeshEtcdImpl) DeRegService(projectName string, projectVersion string, serviceIP string, servicePort int, timeout int) error
DeRegService deregister service
func (*ServiceMeshEtcdImpl) GetClient ¶
func (s *ServiceMeshEtcdImpl) GetClient() interface{}
GetClient get etcd client
func (*ServiceMeshEtcdImpl) RegService ¶
func (s *ServiceMeshEtcdImpl) RegService(projectName string, projectVersion string, serviceIP string, servicePort int, Tags []string, timeout int) error
RegService register etcd service
Click to show internal directories.
Click to hide internal directories.