camGRpcClient

package
v0.5.3 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2020 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GRpcClientComponent

type GRpcClientComponent struct {
	component.Component
	// contains filtered or unexported fields
}

func (*GRpcClientComponent) GetConn

func (comp *GRpcClientComponent) GetConn() *grpc.ClientConn

get connect, use this conn to create GRpc Service

func (*GRpcClientComponent) Init

init conf

func (*GRpcClientComponent) Start

func (comp *GRpcClientComponent) Start()

start

func (*GRpcClientComponent) Stop

func (comp *GRpcClientComponent) Stop()

stop

type GRpcClientComponentConfig

type GRpcClientComponentConfig struct {
	component.ComponentConfig
	Option
}

gRpc client component's conf

func NewGRpcClient

func NewGRpcClient() *GRpcClientComponentConfig

new gRpc client conf

func (*GRpcClientComponentConfig) SetOption

func (conf *GRpcClientComponentConfig) SetOption(option *Option)

set Option

type Option

type Option struct {
	LoadBalancingLogic camStatics.GRpcLoadBalancingLogic
	// Server config
	Servers []*Server
}

client options

type Server

type Server struct {
	// addr
	// Example: "localhost:50051"
	Addr string
	// dial options
	// Example: grpc.WithInsecure(), grpc.WithBlock()
	DialOptions []grpc.DialOption
}

server struct

Jump to

Keyboard shortcuts

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