transport

package
v0.0.0-...-128b944 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2023 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GRPCServer

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

GRPCServer is a simple wrapper around grpc.Server.

func NewGRPCServer

func NewGRPCServer(
	host string,
	port int,
	logger *logger.Logger,
	customUnaryInterceptors ...grpc.UnaryServerInterceptor,
) (*GRPCServer, error)

NewGRPCServer creates a new grpc server.

func (*GRPCServer) Start

func (s *GRPCServer) Start() error

Start starts the grpc server.

func (*GRPCServer) Stop

func (s *GRPCServer) Stop(context.Context) error

Stop stops the grpc server.

type HTTPServer

type HTTPServer struct {
	*gin.Engine
	// contains filtered or unexported fields
}

HTTPServer is the main HTTP server.

func NewHTTPServer

func NewHTTPServer(
	prod bool,
	service string,
	host string,
	port int,
	logger *logger.Logger,
) (*HTTPServer, error)

NewHTTPServer creates a new Server.

func (*HTTPServer) Start

func (s *HTTPServer) Start() error

Start starts the server. It blocks until the server stops.

func (*HTTPServer) Stop

func (s *HTTPServer) Stop(ctx context.Context) error

Stop stops the server.

Jump to

Keyboard shortcuts

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