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 ¶
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 ¶
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) }