grpcserve

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2024 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(*Server)

Option for queue system

func WithGrpcServerOption

func WithGrpcServerOption(grpcOpt grpc.ServerOption) Option

WithGrpcServerOption set grpc.ServerOption function

func WithGrpcServerOptions

func WithGrpcServerOptions(grpcOpts ...grpc.ServerOption) Option

WithGrpcServerOptions set grpc.ServerOption function

func WithHost

func WithHost(host string) Option

WithHost set host function

func WithLogger

func WithLogger(logger glog.ILogger) Option

WithLogger set logger function

func WithPort

func WithPort(port int) Option

WithPort set port function

func WithProtocol

func WithProtocol(protocol string) Option

WithProtocol set protocol function

func WithServiceName

func WithServiceName(serviceName string) Option

WithServiceName set serviceName function

func WithTransportCredentials

func WithTransportCredentials(credentials credentials.TransportCredentials) Option

WithTransportCredentials set credentials.TransportCredentials function

func WithVersion

func WithVersion(version string) Option

WithVersion set version function

type Server

type Server struct {
	Ctx         context.Context
	Tracer      *tracer.Server
	Logger      glog.ILoggerEntry
	ServiceName string
	Host        string
	Port        int

	Version string

	GServer *grpc.Server
	// contains filtered or unexported fields
}

func New

func New(opts ...Option) *Server

func (*Server) AddDiscovery

func (s *Server) AddDiscovery(client discovery.Discovery) *Server

func (*Server) AddGrpcServerOption

func (s *Server) AddGrpcServerOption(grpcOpt grpc.ServerOption) *Server

AddGrpcServerOption set grpc.ServerOption function

func (*Server) AddGrpcServerOptions

func (s *Server) AddGrpcServerOptions(grpcOpts ...grpc.ServerOption) *Server

AddGrpcServerOptions set grpc.ServerOption function

func (*Server) AddTrace

func (s *Server) AddTrace(tracer *tracer.Server) *Server

func (*Server) HostInfo added in v0.4.7

func (s *Server) HostInfo() *host.InfoStat

func (*Server) IsDevelopment

func (s *Server) IsDevelopment() bool

func (*Server) IsProduction

func (s *Server) IsProduction() bool

func (*Server) IsTest

func (s *Server) IsTest() bool

func (*Server) NewServer

func (s *Server) NewServer() *Server

func (*Server) PrintHostInfo added in v0.4.6

func (s *Server) PrintHostInfo()

func (*Server) Run

func (s *Server) Run()

func (*Server) SetRunMode

func (s *Server) SetRunMode(mode string)

func (*Server) Shutdown

func (s *Server) Shutdown()

func (*Server) StopNotify

func (s *Server) StopNotify(sig os.Signal)

Jump to

Keyboard shortcuts

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