rpc

package
v1.1.13 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2020 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) 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