grpc

package
v0.0.23 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ServerMaintenanceType = types.NewLogType("PROTOBUF_SERVER_MAINTENANCE")
)

Functions

func GetManager

func GetManager() *manager

GetManager - This function returns singleton instance of gRPC Manager

func NewCreateServerErr

func NewCreateServerErr(err error) error

NewCreateServerErr - return a new instance of CreateServerErr

func NewGrpcDialError

func NewGrpcDialError(addr string, err error) error

NewGrpcDialError - return a new instance of GrpcDialError

func NewGrpcServerNotExistError

func NewGrpcServerNotExistError(name string) error

NewGrpcServerNotExistError - return a new instance of GrpcServerNotExistError

func NewGrpcServerStartError

func NewGrpcServerStartError(err error) error

NewGrpcServerStartError - return a new instance of GrpcServerStartError

func NewNilServiceRegistryError

func NewNilServiceRegistryError() error

NewNilServiceRegistryError - return a new instance of NilServiceRegistryError

Types

type CreateServerErr

type CreateServerErr struct {
	Err error
}

CreateServerErr Error

func (*CreateServerErr) Error

func (err *CreateServerErr) Error() string

Error method - satisfying error interface

type GrpcDialError

type GrpcDialError struct {
	Err error
	// contains filtered or unexported fields
}

GrpcDialError struct

func (*GrpcDialError) Error

func (err *GrpcDialError) Error() string

Error method - satisfying error interface

type GrpcServerNotExistError

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

GrpcServerNotExistError struct

func (*GrpcServerNotExistError) Error

func (err *GrpcServerNotExistError) Error() string

Error method - satisfying error interface

type GrpcServerStartError

type GrpcServerStartError struct {
	Err error
}

GrpcServerStartError struct

func (*GrpcServerStartError) Error

func (err *GrpcServerStartError) Error() string

Error method - satisfying error interface

type NilServiceRegistryError

type NilServiceRegistryError struct {
}

NilServiceRegistryError struct

func (*NilServiceRegistryError) Error

func (err *NilServiceRegistryError) Error() string

Error method - satisfying error interface

type ServerConfig

type ServerConfig struct {
	Host       string                 `json:"host"`
	Port       int                    `json:"port"`
	Protocol   string                 `json:"protocol"`
	Async      bool                   `json:"async"`
	Reflection bool                   `json:"reflection"`
	Configs    map[string]interface{} `json:"configs"`
}

type ServerWrapper

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

ServerWrapper struct

func NewServer

func NewServer(name string, config ServerConfig) (*ServerWrapper, error)

NewServer - create a new instance of Server and return it

func (*ServerWrapper) GetGrpcServer

func (s *ServerWrapper) GetGrpcServer() *grpc.Server

func (*ServerWrapper) IsInitialized

func (s *ServerWrapper) IsInitialized() bool

IsInitialized - return whether the server is started or not

func (*ServerWrapper) RegisterController

func (s *ServerWrapper) RegisterController(desc *grpc.ServiceDesc, realClass interface{}) error

func (*ServerWrapper) Start

func (s *ServerWrapper) Start(ch *chan error) error

Start - start the server with option of async capability

func (*ServerWrapper) Stop

func (s *ServerWrapper) Stop()

Stop - stop the server

Jump to

Keyboard shortcuts

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