siface

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2024 License: MIT Imports: 6 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IAuthMiddleware added in v1.0.2

type IAuthMiddleware interface {
	// Auth is the method to authenticate the every grpc request
	Auth(ctx context.Context) (context.Context, error)
	// AddUnAuthMethod is the method to add the unauth method name
	AddUnAuthMethod(method string)
}

IAuthMiddleware is the interface for the auth middleware, which is used to authenticate the request.

type IConnectionMux

type IConnectionMux interface {
	IServer
	GrpcListener() (net.Listener, error)
	HTTPListener() (net.Listener, error)
}

IConnectionMux is the interface for the connection mux, which is used to create the listener for the grpc and http. Implement this interface to create the listener for the grpc and http.

type IGatewayServer

type IGatewayServer interface {
	IServer
	GatewayRuntimeMux() *runtime.ServeMux
	GatewayOption() []grpc.DialOption
	GatewayServer() *http.Server
	Endpoint() string
}

IGatewayServer is the interface for the gateway server, which is used to create the gateway server.

type IGatewayService

type IGatewayService interface {
	RegisterWithGatewayServer(server IGatewayServer) error
}

IGatewayService is the interface for the gateway service, which is used to register with the gateway server. Implement this interface to register the service with the gateway server.

type service struct Service{}

func (s *Service) RegisterWithGatewayServer(server IGatewayServer) error {
	return pb.RegisterDemoServiceHandlerFromEndpoint(
		context.Background(), server.GatewayRuntimeMux(), s.url, server.GatewayOption(),
	)
}

type IGrpcServer

type IGrpcServer interface {
	IServer
	GrpcServer() *grpc.Server
}

IGrpcServer is the interface for the grpc server, which is used to create the grpc server.

type IGrpcService

type IGrpcService interface {
	RegisterWithGrpcServer(server IGrpcServer) error
}

type IServer

type IServer interface {
	StartServing(ctx context.Context) error
	StopServing(ctx context.Context) error
}

IServer is the interface for the server, which is used to start and stop the server. Implement this interface to start and stop the server.

type IZinxServer

type IZinxServer interface {
	IServer
	ZinxServer() ziface.IServer
}

IZinxServer is the interface for the zinx server, which is used to create the zinx server.

type IZinxService

type IZinxService interface {
	RegisterWithServer(server IZinxServer)
}

IZinxService is the interface for the zinx service, which is used to register with the zinx server. Implement this interface to register the service with the zinx server.

type service struct Service{}

func (s *Service) RegisterWithServer(server IZinxServer) {
	server.ZinxServer().AddRouter(1,s.HandlerFunc)
}

Jump to

Keyboard shortcuts

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