Documentation ¶
Index ¶
- func Listen(ctx context.Context, opts ListenOpts, registerServices func(Server)) error
- func MakeTCPListener(address string, port int) func(context.Context) (net.Listener, error)
- func NewHTTPMux(middleware ...mux.MiddlewareFunc) *mux.Router
- func OrderedServerInterceptors() []grpc.ServerOption
- func Run(ctx context.Context, opts RunOpts, listenOpts ListenOpts)
- type HTTPOptions
- type ListenOpts
- type Registrar
- type RunOpts
- type Server
- type ServerImpl
- func (s *ServerImpl) Handle(path string, p http.Handler) *mux.Route
- func (s *ServerImpl) HandleFunc(path string, f func(http.ResponseWriter, *http.Request)) *mux.Route
- func (s *ServerImpl) InternalRegisterGrpcGateway(reg func(context.Context, *runtime.ServeMux, *grpc.ClientConn) error)
- func (s *ServerImpl) PathPrefix(path string) *mux.Route
- func (g *ServerImpl) RegisterGrpcGateway(reg func(context.Context, *runtime.ServeMux, *grpc.ClientConn) error)
- func (s *ServerImpl) RegisterService(desc *grpc.ServiceDesc, impl interface{})
- func (s *ServerImpl) Scope(pkg *core.Package) Registrar
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Listen ¶
func Listen(ctx context.Context, opts ListenOpts, registerServices func(Server)) error
func MakeTCPListener ¶
func NewHTTPMux ¶ added in v0.0.259
func NewHTTPMux(middleware ...mux.MiddlewareFunc) *mux.Router
func OrderedServerInterceptors ¶ added in v0.0.294
func OrderedServerInterceptors() []grpc.ServerOption
Types ¶
type HTTPOptions ¶ added in v0.0.300
type HTTPOptions struct { HTTP1ReadTimeout time.Duration `json:"http_read_timeout"` HTTP1ReadHeaderTimeout time.Duration `json:"http_read_header_timeout"` HTTP1WriteTimeout time.Duration `json:"http_write_timeout"` HTTP1IdleTimeout time.Duration `json:"http_idle_timeout"` HTTP1MaxHeaderBytes int `json:"http_max_header_bytes"` HTTP2MaxConcurrentStreams uint32 `json:"http2_max_concurrent_streams"` HTTP2MaxReadFrameSize uint32 `json:"http2_max_read_frame_size"` HTTP2IdleTimeout time.Duration `json:"http2_idle_timeout"` HTTP2MaxUploadBufferPerConnection int32 `json:"http2_max_upload_buffer_per_connection"` HTTP2MaxUploadBufferPerStream int32 `json:"http2_max_upload_buffer_per_stream"` }
type ListenOpts ¶
type RunOpts ¶
type RunOpts struct { PackageName string RegisterInitializers func(*core.DependencyGraph) WireServices func(context.Context, Server, core.Dependencies) []error }
type ServerImpl ¶
type ServerImpl struct {
// contains filtered or unexported fields
}
Implements the grpc.ServiceRegistrar interface.
func (*ServerImpl) HandleFunc ¶
func (s *ServerImpl) HandleFunc(path string, f func(http.ResponseWriter, *http.Request)) *mux.Route
func (*ServerImpl) InternalRegisterGrpcGateway ¶
func (s *ServerImpl) InternalRegisterGrpcGateway(reg func(context.Context, *runtime.ServeMux, *grpc.ClientConn) error)
func (*ServerImpl) PathPrefix ¶
func (s *ServerImpl) PathPrefix(path string) *mux.Route
func (*ServerImpl) RegisterGrpcGateway ¶
func (g *ServerImpl) RegisterGrpcGateway(reg func(context.Context, *runtime.ServeMux, *grpc.ClientConn) error)
Deprecated; should use InternalRegisterGrpcGateway.
func (*ServerImpl) RegisterService ¶
func (s *ServerImpl) RegisterService(desc *grpc.ServiceDesc, impl interface{})
Click to show internal directories.
Click to hide internal directories.