sd

package
v0.1.38 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2021 License: MIT Imports: 14 Imported by: 0

Documentation

Index

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

Jump to

Keyboard shortcuts

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