rpc

package
v1.8.7 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Host    string
	Port    int
	Network string // Network network type, tcp4 by default

	Name string
	// contains filtered or unexported fields
}

Config ...

func (*Config) Address

func (config *Config) Address() string

func (*Config) Build

func (config *Config) Build() *Server

Build ...

func (*Config) WithHost

func (config *Config) WithHost(host string) *Config

WithHost ...

func (*Config) WithName

func (config *Config) WithName(name string) *Config

WithName ...

func (*Config) WithNetwork

func (config *Config) WithNetwork(network string) *Config

WithNetwork ...

func (*Config) WithPort

func (config *Config) WithPort(port int) *Config

WithPort ...

func (*Config) WithServerOption

func (config *Config) WithServerOption(options ...grpc.ServerOption) *Config

WithServerOption inject server option to grpc server User should not inject interceptor option, which is recommend by WithStreamInterceptor and WithUnaryInterceptor

func (*Config) WithStreamInterceptor

func (config *Config) WithStreamInterceptor(intes ...grpc.StreamServerInterceptor) *Config

WithStreamInterceptor inject stream interceptors to server option

func (*Config) WithUnaryInterceptor

func (config *Config) WithUnaryInterceptor(intes ...grpc.UnaryServerInterceptor) *Config

WithUnaryInterceptor inject unary interceptors to server option

type Server

type Server struct {
	*grpc.Server
	// contains filtered or unexported fields
}

Server ...

func (*Server) GracefulStop

func (s *Server) GracefulStop(ctx context.Context) error

GracefulStop implements server.Server interface it will stop echo server gracefully

func (*Server) Info

func (s *Server) Info() *server.ServiceInfo

func (*Server) Serve

func (s *Server) Serve() error

Serve implements server.Server interface.

func (*Server) Shutdown added in v1.7.19

func (s *Server) Shutdown() error

func (*Server) Stop

func (s *Server) Stop() error

Stop implements server.Server interface it will terminate echo server immediately

Jump to

Keyboard shortcuts

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