grpc

package
v0.0.13 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2021 License: BSD-3-Clause Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Provider

Functions

This section is empty.

Types

type Client

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

Client

func NewClient

func NewClient(o *ClientOptions, tracer opentracing.Tracer) (*Client, error)

NewClient

func (*Client) Dial

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

Dial

type ClientOptional

type ClientOptional func(o *ClientOptions)

ClientOptional

func WithConsulConfig added in v0.0.10

func WithConsulConfig(consul *consulApi.Config) ClientOptional

WithConsulConfig

func WithGrpcDialOptions

func WithGrpcDialOptions(options ...grpc.DialOption) ClientOptional

WithGrpcDialOptions

func WithTag

func WithTag(tag string) ClientOptional

WithTag

func WithTarget added in v0.0.4

func WithTarget(t string) ClientOptional

WithTarget "consul://xxx" or ip+port "xx.xx.xx.xx:xxxx"

func WithTimeout

func WithTimeout(d time.Duration) ClientOptional

WithTimeout

type ClientOptions

type ClientOptions struct {
	Target string // "consul://xxx" or ip+port "xx.xx.xx.xx:xxxx"
	Wait   time.Duration
	Tag    string
	// contains filtered or unexported fields
}

ClientOptions

func NewClientOptions

func NewClientOptions(v *viper.Viper) (*ClientOptions, error)

NewClientOptions

type InitServers

type InitServers func(s *grpc.Server)

InitServers

type Server

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

Server

func NewServer

func NewServer(o *ServerOption, logger *zap.Logger, tracer opentracing.Tracer, init InitServers) (*Server, error)

NewServer

func (*Server) AppName added in v0.0.5

func (s *Server) AppName(name string)

AppName

func (*Server) ConsulClient added in v0.0.5

func (s *Server) ConsulClient(cli *consulApi.Client)

ConsulClient

func (*Server) Start

func (s *Server) Start(opts ...options.ServerOptional) error

Start

func (*Server) Stop

func (s *Server) Stop() error

Stop

type ServerOption added in v0.0.8

type ServerOption struct {
	options.ServerOption
}

ServerOption

func NewOptions added in v0.0.8

func NewOptions(v *viper.Viper) (*ServerOption, error)

NewOptions

Jump to

Keyboard shortcuts

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