rpc

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2021 License: MIT Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(o *ClientOptions, conf *config.AppConfig, logger log.Logger) (*Client, error)

func (*Client) Dial

func (c *Client) Dial(service string, options ...ClientOptional) (*grpc.ClientConn, error)

type ClientOptional

type ClientOptional func(o *ClientOptions)

func WithTag

func WithTag(tag string) ClientOptional

WithTag tag info

func WithTimeout

func WithTimeout(d time.Duration) ClientOptional

WithTimeout timeout

type ClientOptions

type ClientOptions struct {
	Wait            time.Duration
	Tag             string
	GrpcDialOptions []grpc.DialOption
}

func NewClientOptions

func NewClientOptions(tracer opentracing.Tracer) (*ClientOptions, error)

type InitServer

type InitServer func(s *grpc.Server)

type Server

type Server struct {
	// contains filtered or unexported fields
}

func NewServer

func NewServer(opt *config.AppConfig, z *zap.Logger, logger log.Logger, init InitServer, tracer opentracing.Tracer, rdb *redis.Client, nc *newrelic.App) (*Server, error)

func (*Server) Register

func (s *Server) Register(f func(gs *grpc.Server) error) error

func (*Server) Start

func (s *Server) Start() error

func (*Server) Stop

func (s *Server) Stop() error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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