Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RunGrpcServ ¶
func RunGrpcServ(ctx context.Context, cfg *GrpcConfig) error
Types ¶
type AutoReConn ¶
type AutoReConn struct {
Connection
Ready chan bool
Done chan bool
Reconnect chan bool
Error chan error
// contains filtered or unexported fields
}
func NewAutoReconn ¶
func NewAutoReconn(address string) *AutoReConn
func (*AutoReConn) Close ¶ added in v0.3.1
func (my *AutoReConn) Close() error
func (*AutoReConn) Connect ¶
func (my *AutoReConn) Connect() (Connection, error)
func (*AutoReConn) IsValid ¶
func (my *AutoReConn) IsValid() bool
func (*AutoReConn) Process ¶
func (my *AutoReConn) Process(f GetGrpcFunc)
func (*AutoReConn) SetLog ¶ added in v0.3.1
func (my *AutoReConn) SetLog(l log.Logger)
func (*AutoReConn) Start ¶ added in v0.3.1
func (my *AutoReConn) Start(f GetGrpcFunc)
type AutoReConnInter ¶ added in v0.3.1
type Connection ¶
type Connection interface {
grpc.ClientConnInterface
Close() error
IsValid() bool
WaitUntilReady() bool
}
func NewConnection ¶
func NewConnection(address string) (Connection, error)
type GetGrpcFunc ¶
type GetGrpcFunc func(myGrpc Connection) error
type GrpcConfig ¶
type GrpcConfig struct {
Port int `env:"GRPC_PORT"`
ReflectService bool `env:"GRPC_REFLECT"`
Logger Log
// contains filtered or unexported fields
}
func GetConfigFromEnv ¶
func GetConfigFromEnv() (*GrpcConfig, error)
func (*GrpcConfig) SetInterceptors ¶
func (c *GrpcConfig) SetInterceptors(i ...interceptor.Interceptor)
func (*GrpcConfig) SetRegisterServiceFunc ¶
func (c *GrpcConfig) SetRegisterServiceFunc(f func(grpcServer *grpc.Server))
Click to show internal directories.
Click to hide internal directories.