Documentation ¶
Index ¶
- Constants
- type Component
- type Server
- func (s *Server) AddMux(scope permission.VisibleScope, rpcPort, gatewayPort uint16) error
- func (s *Server) Context() context.Context
- func (s *Server) GetGRPCServer(scope permission.VisibleScope) []*grpc.Server
- func (s *Server) GetGatewayMux(scope permission.VisibleScope) []*runtime.ServeMux
- func (s *Server) Handle(scope permission.VisibleScope, pattern string, handler http.Handler)
- func (s *Server) HandleFunc(scope permission.VisibleScope, pattern string, handler http.HandlerFunc)
- func (s *Server) Register(comp Component, rpcs ...string) error
- func (s *Server) Serve(isolate ...bool) error
- func (s *Server) StreamInterceptor() grpc.StreamServerInterceptor
- func (s *Server) UnaryInterceptor() grpc.UnaryServerInterceptor
- type ServerOption
- type Service
Constants ¶
View Source
const ( DefaultClientRpcPort = 8080 DefaultClientGatewayPort = 8081 DefaultServerRpcPort = 8088 DefaultServerGatewayPort = 8089 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Component ¶
type Component interface { // // Invoked when registering component. // // Return the component name. Name() string // Init component. Init(configure.Configure) error // Init storage. InitStorage(storage.Storage) error // Register HTTP handler. RegisterHandler(outer, inner *http.ServeMux) error // Register service. RegisterService(service.Authenticator, service.Implementor) error // // Invoked when serving. // // Run queue consume workers. RunQueueWorker(queue.Queue) error // Schedule cron tasks. ScheduleCronTask(task.Task) error }
Service component.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func (*Server) AddMux ¶
func (s *Server) AddMux(scope permission.VisibleScope, rpcPort, gatewayPort uint16) error
func (*Server) GetGRPCServer ¶
func (s *Server) GetGRPCServer(scope permission.VisibleScope) []*grpc.Server
Get gRPC server of the specified visible scope.
func (*Server) GetGatewayMux ¶
func (s *Server) GetGatewayMux(scope permission.VisibleScope) []*runtime.ServeMux
Get gateway mux of the specified visible scope.
func (*Server) Handle ¶
func (s *Server) Handle(scope permission.VisibleScope, pattern string, handler http.Handler)
func (*Server) HandleFunc ¶
func (s *Server) HandleFunc(scope permission.VisibleScope, pattern string, handler http.HandlerFunc)
func (*Server) StreamInterceptor ¶
func (s *Server) StreamInterceptor() grpc.StreamServerInterceptor
Return the stream server interceptor for local gateway handler server.
func (*Server) UnaryInterceptor ¶
func (s *Server) UnaryInterceptor() grpc.UnaryServerInterceptor
Return the unary server interceptor for local gateway handler server.
type ServerOption ¶
type ServerOption func(*Server)
func WithContext ¶
func WithContext(ctx context.Context) ServerOption
func WithDefaultClientMux ¶
func WithDefaultClientMux() ServerOption
func WithDefaultServerMux ¶
func WithDefaultServerMux() ServerOption
func WithKeepAliveTTL ¶
func WithKeepAliveTTL(ttl time.Duration) ServerOption
func WithMux ¶
func WithMux(scope permission.VisibleScope, rpcPort, gatewayPort uint16) ServerOption
type Service ¶
type Service interface { service.Implementor // Scoped http handler. Handle(scope permission.VisibleScope, pattern string, handler http.Handler) // Scoped http handle function. HandleFunc(scope permission.VisibleScope, pattern string, handler http.HandlerFunc) // Add scoped ServeMux. AddMux(permission.VisibleScope, uint16, uint16) error // Register component. Register(Component, ...string) error // Serve start the mux server. Serve(isolate ...bool) error }
func NewServer ¶
func NewServer(opts ...ServerOption) Service
Directories ¶
Path | Synopsis |
---|---|
util
|
|
scheduler
https://github.com/robfig/cron/blob/v3.0.1/constantdelay.go https://github.com/robfig/cron/blob/v3.0.1/parser.go https://github.com/robfig/cron/blob/v3.0.1/spec.go
|
https://github.com/robfig/cron/blob/v3.0.1/constantdelay.go https://github.com/robfig/cron/blob/v3.0.1/parser.go https://github.com/robfig/cron/blob/v3.0.1/spec.go |
Click to show internal directories.
Click to hide internal directories.