grpc

package
v0.0.0-...-ce62dce Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2024 License: Apache-2.0 Imports: 21 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(consulOptions *consul.Options, o *ClientOptions) (*Client, error)

func (*Client) Dial

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

type ClientOptional

type ClientOptional func(o *ClientOptions)

func WithGrpcDialOptions

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

func WithTag

func WithTag(tag string) ClientOptional

func WithTimeout

func WithTimeout(d time.Duration) ClientOptional

type ClientOptions

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

func NewClientOptions

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

type InitServers

type InitServers func(s *grpc.Server)

type Server

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

func NewServer

func NewServer(o *ServerOptions, logger *zap.Logger, init InitServers, consulCli *consulApi.Client, tracer opentracing.Tracer) (*Server, error)

func (*Server) Application

func (s *Server) Application(name string)

func (*Server) Start

func (s *Server) Start() error

func (*Server) Stop

func (s *Server) Stop() error

type ServerOptions

type ServerOptions struct {
	Port int
}

func NewServerOptions

func NewServerOptions(v *viper.Viper) (*ServerOptions, error)

Jump to

Keyboard shortcuts

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