{"modulePath":"github.com/cloudentity/go-swagger","version":"v0.29.1","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package restapi\n\nPackage restapi Issue Tracker API\n\n\tThis application implements a very simple issue tracker.\n\tIt's implemented as an API which is described by this swagger spec document.\n\n\tThe go-swagger project uses this specification to test the code generation.\n\tThis document contains all possible values for a swagger definition.\n\tThis means that it exercises the framework relatively well.\n\n\tTerms Of Service:\n\t  /termsOfService.html\n\tSchemes:\n\t  http\n\t  https\n\tHost: localhost:8322\n\tBasePath: /api\n\tVersion: 1.0.0\n\tLicense: Apache 2.0 http://www.apache.org/licenses/LICENSE-2.0.html\n\tContact: Issue Tracker API Team\u003cnobody@nowhere.com\u003e https://task-tracker.goswagger.io\n\n\tConsumes:\n\t  - application/vnd.goswagger.examples.task-tracker.v1+json\n\t  - multipart/form-data\n\n\tProduces:\n\t  - application/vnd.goswagger.examples.task-tracker.v1+json\n\nswagger:meta\n\n## Variables\n\n```go\nvar (\n\t// SwaggerJSON embedded version of the swagger document used at generation time\n\tSwaggerJSON json.RawMessage\n\t// FlatSwaggerJSON embedded flattened version of the swagger document used at generation time\n\tFlatSwaggerJSON json.RawMessage\n)\n```\n\n## Types\n\n```go\ntype Server struct {\n\tEnabledListeners []string         `long:\"scheme\" description:\"the listeners to enable, this can be repeated and defaults to the schemes in the swagger spec\"`\n\tCleanupTimeout   time.Duration    `long:\"cleanup-timeout\" description:\"grace period for which to wait before killing idle connections\" default:\"10s\"`\n\tGracefulTimeout  time.Duration    `long:\"graceful-timeout\" description:\"grace period for which to wait before shutting down the server\" default:\"15s\"`\n\tMaxHeaderSize    flagext.ByteSize `long:\"max-header-size\" description:\"controls the maximum number of bytes the server will read parsing the request header's keys and values, including the request line. It does not limit the size of the request body.\" default:\"1MiB\"`\n\n\tSocketPath flags.Filename `long:\"socket-path\" description:\"the unix socket to listen on\" default:\"/var/run/task-tracker.sock\"`\n\n\tHost         string        `long:\"host\" description:\"the IP to listen on\" default:\"localhost\" env:\"HOST\"`\n\tPort         int           `long:\"port\" description:\"the port to listen on for insecure connections, defaults to a random value\" env:\"PORT\"`\n\tListenLimit  int           `long:\"listen-limit\" description:\"limit the number of outstanding requests\"`\n\tKeepAlive    time.Duration `long:\"keep-alive\" description:\"sets the TCP keep-alive timeouts on accepted connections. It prunes dead TCP connections ( e.g. closing laptop mid-download)\" default:\"3m\"`\n\tReadTimeout  time.Duration `long:\"read-timeout\" description:\"maximum duration before timing out read of the request\" default:\"30s\"`\n\tWriteTimeout time.Duration `long:\"write-timeout\" description:\"maximum duration before timing out write of the response\" default:\"60s\"`\n\n\tTLSHost           string         `long:\"tls-host\" description:\"the IP to listen on for tls, when not specified it's the same as --host\" env:\"TLS_HOST\"`\n\tTLSPort           int            `long:\"tls-port\" description:\"the port to listen on for secure connections, defaults to a random value\" env:\"TLS_PORT\"`\n\tTLSCertificate    flags.Filename `long:\"tls-certificate\" description:\"the certificate to use for secure connections\" env:\"TLS_CERTIFICATE\"`\n\tTLSCertificateKey flags.Filename `long:\"tls-key\" description:\"the private key to use for secure connections\" env:\"TLS_PRIVATE_KEY\"`\n\tTLSCACertificate  flags.Filename `long:\"tls-ca\" description:\"the certificate authority file to be used with mutual tls auth\" env:\"TLS_CA_CERTIFICATE\"`\n\tTLSListenLimit    int            `long:\"tls-listen-limit\" description:\"limit the number of outstanding requests\"`\n\tTLSKeepAlive      time.Duration  `long:\"tls-keep-alive\" description:\"sets the TCP keep-alive timeouts on accepted connections. It prunes dead TCP connections ( e.g. closing laptop mid-download)\"`\n\tTLSReadTimeout    time.Duration  `long:\"tls-read-timeout\" description:\"maximum duration before timing out read of the request\"`\n\tTLSWriteTimeout   time.Duration  `long:\"tls-write-timeout\" description:\"maximum duration before timing out write of the response\"`\n\t// contains filtered or unexported fields\n}\n```\nServer for the task tracker API\n\n```go\nfunc NewServer(api *operations.TaskTrackerAPI) *Server\n```\nNewServer creates a new api task tracker server but does not configure it\n\n```go\nfunc (s *Server) ConfigureAPI()\n```\nConfigureAPI configures the API and handlers.\n\n```go\nfunc (s *Server) ConfigureFlags()\n```\nConfigureFlags configures the additional flags defined by the handlers. Needs to be called before the parser.Parse\n\n```go\nfunc (s *Server) Fatalf(f string, args ...interface{})\n```\nFatalf logs message either via defined user logger or via system one if no user logger is defined. Exits with non-zero status after printing\n\n```go\nfunc (s *Server) GetHandler() http.Handler\n```\nGetHandler returns a handler useful for testing\n\n```go\nfunc (s *Server) HTTPListener() (net.Listener, error)\n```\nHTTPListener returns the http listener\n\n```go\nfunc (s *Server) Listen() error\n```\nListen creates the listeners for the server\n\n```go\nfunc (s *Server) Logf(f string, args ...interface{})\n```\nLogf logs message either via defined user logger or via system one if no user logger is defined.\n\n```go\nfunc (s *Server) Serve() (err error)\n```\nServe the api\n\n```go\nfunc (s *Server) SetAPI(api *operations.TaskTrackerAPI)\n```\nSetAPI configures the server with the specified API. Needs to be called before Serve\n\n```go\nfunc (s *Server) SetHandler(handler http.Handler)\n```\nSetHandler allows for setting a http handler on this server\n\n```go\nfunc (s *Server) Shutdown() error\n```\nShutdown server and clean up resources\n\n```go\nfunc (s *Server) TLSListener() (net.Listener, error)\n```\nTLSListener returns the https listener\n\n```go\nfunc (s *Server) UnixListener() (net.Listener, error)\n```\nUnixListener returns the domain socket listener\n\n","path":"github.com/cloudentity/go-swagger/examples/task-tracker/restapi","name":"restapi","synopsis":"Package restapi Issue Tracker API","isRedistributable":true}
