http

package
v0.0.0-...-4fe6537 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GrpcOptions

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

func NewGrpcOptions

func NewGrpcOptions(logger loggerInterface, authMiddleware grpc.UnaryServerInterceptor) *GrpcOptions

type HandlerFunc

type HandlerFunc func(*context.Context)

func (HandlerFunc) ServeHTTP

ServeHTTP implements http.Handler.

type IHttpClient

type IHttpClient interface {
	Run(ConnString string) error
	Get(relativePath string, handlerFunction ...http.HandlerFunc)
	Put(relativePath string, handlerFunction ...http.HandlerFunc)
	Patch(relativePath string, handlerFunction ...http.HandlerFunc)
	Delete(relativePath string, handlerFunction ...http.HandlerFunc)
	Post(relativePath string, handlerFunction ...http.HandlerFunc)
	NewSubGroup(path string, handleFunctions ...http.HandlerFunc) IHttpClient
	Any(relativePath string, handlerFunction ...gin.HandlerFunc)
	Use(handlerFunction ...http.HandlerFunc)
	GetGrpcServerInstanceForRegister() IgrpcGw
	Exit(ctx context.Context, errChannel chan error)
}

func NewHttpServer

func NewHttpServer(ioWriter io.Writer, grpcOptions *GrpcOptions) (IHttpClient, error)

type IgrpcGw

type IgrpcGw interface {
	RegisterServer(registerServerFunc func(grpc.ServiceRegistrar, interface{}), serverInstance interface{})
	RegisterFuncHandler(registerFuncHandlerFunc RegisterFuncHandlerFunc) error
	GetServerInstanceForRegister() *grpc.Server
	GetMuxInstanceForRegister() *runtime.ServeMux
	GetClientInstanceForRegister() *grpc.ClientConn
	StartGrpcServer(ctx context.Context, server IHttpClient) error
	ServerPort(serve net.Listener)
	ConnectClient(clientConnectionString string) error
	Exit(ctx context.Context, errChannel chan error)
}

func NewGrpcGw

func NewGrpcGw(opts *GrpcOptions) (IgrpcGw, error)

type RegisterFuncHandlerFunc

type RegisterFuncHandlerFunc func(context.Context, *runtime.ServeMux, *grpc.ClientConn) error

type RegisterServerFunc

type RegisterServerFunc func(s grpc.ServiceRegistrar, server interface{})

Jump to

Keyboard shortcuts

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