{"modulePath":"github.com/yuuki0xff/goapptrace","version":"v0.3.0-beta","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package httpserver\n\n## Types\n\n```go\ntype HttpServer struct {\n\t// contains filtered or unexported fields\n}\n```\n任意のタイミングで終了可能なサーバ。\n\nUsage\n\n\tsrv := NewHttpServer(\"0.0.0.0:8080\", ServerArgs{})\n\tsrv.Start()\n\tgo func() {\n\t\ttime.Sleep(time.Second)\n\t\tsrv.Stop()\n\t}\n\terr := srv.Wait()\n\n```go\nfunc NewHttpServer(addr string, router http.Handler) *HttpServer\n```\n\n```go\nfunc (srv *HttpServer) Addr() string\n```\nAddr returns binded address of this server.\n\n```go\nfunc (srv *HttpServer) Start() error\n```\nHTTPサーバといくつかのハンドラを起動する。 この関数の実行終了後、Addr()から実際にlistenされたアドレスとポート番号を取得出来る。\n\n```go\nfunc (srv *HttpServer) Stop()\n```\nHTTPサーバと全てのハンドラを停止する。\n\n```go\nfunc (srv *HttpServer) Url() string\n```\nUrl returns complete URL with prefix \"http://\".\n\n```go\nfunc (srv *HttpServer) Wait() error\n```\nHTTPサーバが終了するまで待機する。\n\n","path":"github.com/yuuki0xff/goapptrace/httpserver","name":"httpserver","synopsis":"","isRedistributable":true}
