xgrpc

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2024 License: GPL-3.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Connect

func Connect(host string) (grpc.ClientConnInterface, error)

func GatewayMiddleware added in v0.0.2

func GatewayMiddleware(
	register func(
		ctx context.Context,
		mux *runtime.ServeMux,
		endpoint string,
		opts []grpc.DialOption,
	) (err error),
	endpoint string,
	pattern string,
) echo.MiddlewareFunc

func MustConnect

func MustConnect(host string) grpc.ClientConnInterface

Types

type CustomError added in v0.0.2

type CustomError struct {
	Message string  `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"`
	Toast   *string `protobuf:"bytes,2,opt,name=toast,proto3,oneof" json:"toast,omitempty"`
	// E Code
	Code  *string         `protobuf:"bytes,3,opt,name=code,proto3,oneof" json:"code,omitempty"`
	Error *string         `protobuf:"bytes,4,opt,name=error,proto3,oneof" json:"error,omitempty"`
	Data  *structpb.Value `protobuf:"bytes,5,opt,name=data,proto3" json:"data,omitempty"`
	// contains filtered or unexported fields
}

type Server

type Server struct {
	*grpc.Server
}

func New

func New(configs ...ServerConfigBuilder) *Server

New provides a new gRPC server

func (*Server) Start

func (s *Server) Start(address string) error

Start the gRPC server

type ServerConfig

type ServerConfig struct{}

type ServerConfigBuilder

type ServerConfigBuilder func(*ServerConfig)

Jump to

Keyboard shortcuts

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