MOVE the functions from configure_timeofday.go into its own directory/
package, where we will contain our business logic.
This commit is contained in:
parent
a27ae64d92
commit
013ae484ad
|
@ -0,0 +1,14 @@
|
||||||
|
package clock
|
||||||
|
|
||||||
|
import(
|
||||||
|
middleware "github.com/go-openapi/runtime/middleware"
|
||||||
|
"github.com/elfsternberg/timeofday/restapi/operations"
|
||||||
|
)
|
||||||
|
|
||||||
|
func GetClock(params operations.ClockGetParams) middleware.Responder {
|
||||||
|
return middleware.NotImplemented("operation .ClockGet has not yet been implemented")
|
||||||
|
}
|
||||||
|
|
||||||
|
func PostClock(params operations.ClockPostParams) middleware.Responder {
|
||||||
|
return middleware.NotImplemented("operation .ClockPost has not yet been implemented")
|
||||||
|
}
|
|
@ -8,10 +8,10 @@ import (
|
||||||
|
|
||||||
errors "github.com/go-openapi/errors"
|
errors "github.com/go-openapi/errors"
|
||||||
runtime "github.com/go-openapi/runtime"
|
runtime "github.com/go-openapi/runtime"
|
||||||
middleware "github.com/go-openapi/runtime/middleware"
|
|
||||||
graceful "github.com/tylerb/graceful"
|
graceful "github.com/tylerb/graceful"
|
||||||
|
|
||||||
"github.com/elfsternberg/timeofday/restapi/operations"
|
"github.com/elfsternberg/timeofday/restapi/operations"
|
||||||
|
"github.com/elfsternberg/timeofday/clock"
|
||||||
)
|
)
|
||||||
|
|
||||||
//go:generate swagger generate server --target .. --name --spec ../swagger.yml
|
//go:generate swagger generate server --target .. --name --spec ../swagger.yml
|
||||||
|
@ -34,12 +34,8 @@ func configureAPI(api *operations.TimeofdayAPI) http.Handler {
|
||||||
|
|
||||||
api.JSONProducer = runtime.JSONProducer()
|
api.JSONProducer = runtime.JSONProducer()
|
||||||
|
|
||||||
api.ClockGetHandler = operations.ClockGetHandlerFunc(func(params operations.ClockGetParams) middleware.Responder {
|
api.ClockGetHandler = operations.ClockGetHandlerFunc(clock.GetClock)
|
||||||
return middleware.NotImplemented("operation .ClockGet has not yet been implemented")
|
api.ClockPostHandler = operations.ClockPostHandlerFunc(clock.PostClock)
|
||||||
})
|
|
||||||
api.ClockPostHandler = operations.ClockPostHandlerFunc(func(params operations.ClockPostParams) middleware.Responder {
|
|
||||||
return middleware.NotImplemented("operation .ClockPost has not yet been implemented")
|
|
||||||
})
|
|
||||||
|
|
||||||
api.ServerShutdown = func() {}
|
api.ServerShutdown = func() {}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue