import "github.com/go-swagger/go-swagger/examples/todo-list/restapi"
Package restapi Simple To Do List API
This is a simple todo list API illustrating go-swagger codegen capabilities. Terms Of Service: There are actually none. This is for demonstration purpose only. Schemes: http https Host: localhost BasePath: / Version: 0.1.0 License: Apache 2.0 https://www.apache.org/licenses/LICENSE-2.0 Contact: go-openapi maintainers<nowhere@example.com> https://github.com/go-openapi Consumes: - application/io.swagger.examples.todo-list.v1+json Produces: - application/io.swagger.examples.todo-list.v1+json
swagger:meta
configure_todo_list.go doc.go embedded_spec.go server.go
var ( // SwaggerJSON embedded version of the swagger document used at generation time SwaggerJSON json.RawMessage // FlatSwaggerJSON embedded flattened version of the swagger document used at generation time FlatSwaggerJSON json.RawMessage )
type Server struct { EnabledListeners []string CleanupTimeout time.Duration GracefulTimeout time.Duration MaxHeaderSize flagext.ByteSize SocketPath string Host string Port int ListenLimit int KeepAlive time.Duration ReadTimeout time.Duration WriteTimeout time.Duration TLSHost string TLSPort int TLSCertificate string TLSCertificateKey string TLSCACertificate string TLSListenLimit int TLSKeepAlive time.Duration TLSReadTimeout time.Duration TLSWriteTimeout time.Duration // contains filtered or unexported fields }
Server for the todo list API
func NewServer(api *operations.TodoListAPI) *Server
NewServer creates a new api todo list server but does not configure it
ConfigureAPI configures the API and handlers.
ConfigureFlags configures the additional flags defined by the handlers. Needs to be called before the parser.Parse
Fatalf logs message either via defined user logger or via system one if no user logger is defined. Exits with non-zero status after printing
GetHandler returns a handler useful for testing
HTTPListener returns the http listener
Listen creates the listeners for the server
Logf logs message either via defined user logger or via system one if no user logger is defined.
Serve the api
func (s *Server) SetAPI(api *operations.TodoListAPI)
SetAPI configures the server with the specified API. Needs to be called before Serve
SetHandler allows for setting a http handler on this server
Shutdown server and clean up resources
TLSListener returns the https listener
UnixListener returns the domain socket listener
Path | Synopsis |
---|---|
operations | |
operations/todos |
Package restapi imports 26 packages (graph). Updated 2021-01-18. Refresh now. Tools for package owners.