Documentation
¶
Overview ¶
Example ¶
srv := server.New(&http.Server{ Addr: ":8080", Handler: http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) { w.WriteHeader(http.StatusOK) _, _ = w.Write([]byte("hello world")) }), }) app := kratos.New( kratos.Server(srv), ) if err := app.Run(); err != nil { panic(err) }
Output:
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HTTPServerOption ¶
func WithHTTPServerAddr ¶
func WithHTTPServerAddr(addr string) HTTPServerOption
type Server ¶
func NewWithHandler ¶
func NewWithHandler(handler http.Handler, opts ...HTTPServerOption) *Server
Click to show internal directories.
Click to hide internal directories.