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 // contains filtered or unexported fields }
func NewAutoReconn ¶
func NewAutoReconn(address string, timeout time.Duration) *AutoReConn
func (*AutoReConn) Connect ¶
func (my *AutoReConn) Connect(ctx context.Context) (Connection, error)
func (*AutoReConn) IsValid ¶
func (my *AutoReConn) IsValid() bool
func (*AutoReConn) Process ¶
func (my *AutoReConn) Process(f GetGrpcFunc)
type Connection ¶
type Connection interface { grpc.ClientConnInterface Close() error IsValid() bool WaitUntilReady() bool }
func NewConnection ¶
func NewConnection(ctx context.Context, 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.