client_conn

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2023 License: BSD-3-Clause Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FormatRed    = "\033[31m%s\033[0m"
	FormatGreen  = "\033[32m%s\033[0m"
	FormatYellow = "\033[33m%s\033[0m"
	FormatBlue   = "\033[34m%s\033[0m"
)
View Source
const Name = "kelvins-balancer"

Variables

View Source
var (
	Debug bool
)

Functions

func Blue

func Blue(msg string) string

func Green

func Green(msg string) string

func RPCClientDialOptionAppend

func RPCClientDialOptionAppend(opts []grpc.DialOption)

RPCClientDialOptionAppend only executed at boot load, so no locks are used

func Red

func Red(msg string) string

func Yellow

func Yellow(msg string) string

Types

type ConnClient

type ConnClient struct {
	ServerName string
}

func NewConnClient

func NewConnClient(serviceName string) (*ConnClient, error)

func (*ConnClient) GetConn

func (c *ConnClient) GetConn(ctx context.Context, opts ...grpc.DialOption) (*grpc.ClientConn, error)

GetConn return a valid connection as much as possible

func (*ConnClient) GetEndpoints

func (c *ConnClient) GetEndpoints(ctx context.Context) (endpoints []string, err error)

GetEndpoints the returned endpoint list may have invalid nodes

Jump to

Keyboard shortcuts

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