kit

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2018 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetGrpcBalancer

func GetGrpcBalancer(servicePrefix string, methodName string) (lb.Balancer, bool)

GetGrpcBalancer get fitted balancer for use

func InitialKitGrpc

func InitialKitGrpc(etcdConfig *ETCD3Config, servicePrefix, methodName string, f sd.Factory)

InitialKitGrpc initial a grpc method in client side for using later

func NewClient

func NewClient(etcdConfig *ETCD3Config) (etcdv3.Client, error)

NewClient is a new func for Client

func RPC

func RPC(servicePrefix string, methodName string, req interface{}) (interface{}, error)

RPC is a func to dial the server to do the method

func RegisterService

func RegisterService(etcdConfig *ETCD3Config, servicePrefix string, instance string)

RegisterService is a func that register the service in etcd

Types

type ETCD3Config

type ETCD3Config struct {
	Servers       []string
	DialTimeout   time.Duration
	DialKeepAlive time.Duration
}

ETCD3Config is the etcd config model

Jump to

Keyboard shortcuts

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