func configureAPI(api *operations.ToDoListAPI) { // configure the api here api.ServeError = errors.ServeError api.JSONConsumer = httpkit.JSONConsumer() api.JSONProducer = httpkit.JSONProducer() api.XPetstoreTokenAuth = func(token string) (interface{}, error) { return nil, errors.NotImplemented("api key auth x-petstore-token from header has not yet been implemented") } api.AddOneHandler = todos.AddOneHandlerFunc(func(principal interface{}) middleware.Responder { return middleware.NotImplemented("operation addOne has not yet been implemented") }) api.DestroyOneHandler = todos.DestroyOneHandlerFunc(func(params todos.DestroyOneParams, principal interface{}) middleware.Responder { return middleware.NotImplemented("operation destroyOne has not yet been implemented") }) api.FindHandler = todos.FindHandlerFunc(func(principal interface{}) middleware.Responder { return middleware.NotImplemented("operation find has not yet been implemented") }) api.UpdateOneHandler = todos.UpdateOneHandlerFunc(func(params todos.UpdateOneParams, principal interface{}) middleware.Responder { return middleware.NotImplemented("operation updateOne has not yet been implemented") }) }
func configureAPI(api *operations.TodoListAPI) http.Handler { // configure the api here api.ServeError = errors.ServeError api.JSONConsumer = httpkit.JSONConsumer() api.JSONProducer = httpkit.JSONProducer() api.KeyAuth = func(token string) (interface{}, error) { return nil, errors.NotImplemented("api key auth (key) x-petstore-token from header has not yet been implemented") } api.TodosAddOneHandler = todos.AddOneHandlerFunc(func(params todos.AddOneParams, principal interface{}) middleware.Responder { return middleware.NotImplemented("operation todos.AddOne has not yet been implemented") }) api.TodosDestroyOneHandler = todos.DestroyOneHandlerFunc(func(params todos.DestroyOneParams, principal interface{}) middleware.Responder { return middleware.NotImplemented("operation todos.DestroyOne has not yet been implemented") }) api.TodosFindHandler = todos.FindHandlerFunc(func(params todos.FindParams, principal interface{}) middleware.Responder { return middleware.NotImplemented("operation todos.Find has not yet been implemented") }) api.TodosUpdateOneHandler = todos.UpdateOneHandlerFunc(func(params todos.UpdateOneParams, principal interface{}) middleware.Responder { return middleware.NotImplemented("operation todos.UpdateOne has not yet been implemented") }) api.ServerShutdown = func() {} // api.CommandLineOptionsGroups = []swag.CommandLineOptionsGroup{ ... } return setupGlobalMiddleware(api.Serve(setupMiddlewares)) }
func configureAPI(api *operations.TodoListAPI) http.Handler { // configure the api here api.ServeError = errors.ServeError api.JSONConsumer = httpkit.JSONConsumer() api.JSONProducer = httpkit.JSONProducer() api.TodosAddOneHandler = todos.AddOneHandlerFunc(func(params todos.AddOneParams) middleware.Responder { return middleware.NotImplemented("operation todos.AddOne has not yet been implemented") }) api.TodosDestroyOneHandler = todos.DestroyOneHandlerFunc(func(params todos.DestroyOneParams) middleware.Responder { return middleware.NotImplemented("operation todos.DestroyOne has not yet been implemented") }) api.TodosFindTodosHandler = todos.FindTodosHandlerFunc(func(params todos.FindTodosParams) middleware.Responder { return middleware.NotImplemented("operation todos.FindTodos has not yet been implemented") }) api.TodosUpdateOneHandler = todos.UpdateOneHandlerFunc(func(params todos.UpdateOneParams) middleware.Responder { return middleware.NotImplemented("operation todos.UpdateOne has not yet been implemented") }) api.ServerShutdown = func() {} // api.CommandLineOptionsGroups = []swag.CommandLineOptionsGroup{ ... } return setupGlobalMiddleware(api.Serve(setupMiddlewares)) }
func configureAPI(api *operations.EventListAPI) { // configure the api here api.ServeError = errors.ServeError api.JSONConsumer = httpkit.JSONConsumer() api.JSONProducer = httpkit.JSONProducer() api.DeleteEventByIDHandler = events.DeleteEventByIDHandlerFunc(func(params events.DeleteEventByIDParams) middleware.Responder { return middleware.NotImplemented("operation deleteEventById has not yet been implemented") }) api.PostEventHandler = events.PostEventHandlerFunc(func(params events.PostEventParams) middleware.Responder { return middleware.NotImplemented("operation postEvent has not yet been implemented") }) api.GetEventByIDHandler = events.GetEventByIDHandlerFunc(func(params events.GetEventByIDParams) middleware.Responder { return middleware.NotImplemented("operation getEventById has not yet been implemented") }) api.GetEventsHandler = events.GetEventsHandlerFunc(func() middleware.Responder { return middleware.NotImplemented("operation getEvents has not yet been implemented") }) api.PutEventByIDHandler = events.PutEventByIDHandlerFunc(func(params events.PutEventByIDParams) middleware.Responder { return middleware.NotImplemented("operation putEventById has not yet been implemented") }) }
func configureAPI(api *operations.GophergalaLearningResourcesAPI) http.Handler { // configure the api here api.ServeError = errors.ServeError api.JSONConsumer = httpkit.JSONConsumer() api.JSONProducer = httpkit.JSONProducer() api.AddLearningResourceHandler = operations.AddLearningResourceHandlerFunc(func(params operations.AddLearningResourceParams) middleware.Responder { return middleware.NotImplemented("operation .AddLearningResource has not yet been implemented") }) api.DeleteLearningResourceHandler = operations.DeleteLearningResourceHandlerFunc(func(params operations.DeleteLearningResourceParams) middleware.Responder { return middleware.NotImplemented("operation .DeleteLearningResource has not yet been implemented") }) api.FindLearningResourceByIDHandler = operations.FindLearningResourceByIDHandlerFunc(func(params operations.FindLearningResourceByIDParams) middleware.Responder { return middleware.NotImplemented("operation .FindLearningResourceByID has not yet been implemented") }) api.FindLearningResourcesHandler = operations.FindLearningResourcesHandlerFunc(func(params operations.FindLearningResourcesParams) middleware.Responder { return middleware.NotImplemented("operation .FindLearningResources has not yet been implemented") }) api.ServerShutdown = func() {} // api.CommandLineOptionsGroups = []swag.CommandLineOptionsGroup{ ... } return setupGlobalMiddleware(api.Serve(setupMiddlewares)) }
func configureAPI(api *operations.EventListAPI) http.Handler { // configure the api here api.ServeError = errors.ServeError api.JSONConsumer = httpkit.JSONConsumer() api.JSONProducer = httpkit.JSONProducer() api.EventsDeleteEventByIDHandler = events.DeleteEventByIDHandlerFunc(func(params events.DeleteEventByIDParams) middleware.Responder { return middleware.NotImplemented("operation events.DeleteEventByID has not yet been implemented") }) api.EventsGetEventByIDHandler = events.GetEventByIDHandlerFunc(func(params events.GetEventByIDParams) middleware.Responder { return middleware.NotImplemented("operation events.GetEventByID has not yet been implemented") }) api.EventsGetEventsHandler = events.GetEventsHandlerFunc(func() middleware.Responder { return middleware.NotImplemented("operation events.GetEvents has not yet been implemented") }) api.EventsPostEventHandler = events.PostEventHandlerFunc(func(params events.PostEventParams) middleware.Responder { return middleware.NotImplemented("operation events.PostEvent has not yet been implemented") }) api.EventsPutEventByIDHandler = events.PutEventByIDHandlerFunc(func(params events.PutEventByIDParams) middleware.Responder { return middleware.NotImplemented("operation events.PutEventByID has not yet been implemented") }) return setupGlobalMiddleware(api.Serve(setupMiddlewares)) }
func configureAPI(api *jenkins.JenkinsAPI) http.Handler { // configure the api here api.ServeError = errors.ServeError api.JSONConsumer = httpkit.JSONConsumer() api.JSONProducer = httpkit.JSONProducer() api.JobGetJobListHandler = job.GetJobListHandlerFunc(func() middleware.Responder { return middleware.NotImplemented("operation job.GetJobList has not yet been implemented") }) api.JobGetJobListHandler = job.GetJobListHandlerFunc(logic.GetJobListHandler) api.HealthGetServiceHealthHandler = health.GetServiceHealthHandlerFunc(func() middleware.Responder { return middleware.NotImplemented("operation health.GetServiceHealth has not yet been implemented") }) return setupGlobalMiddleware(api.Serve(setupMiddlewares)) }
func configureAPI(api *operations.TodoListAPI) http.Handler { // configure the api here api.ServeError = errors.ServeError api.JSONConsumer = httpkit.JSONConsumer() api.JSONProducer = httpkit.JSONProducer() api.TodosFindTodosHandler = todos.FindTodosHandlerFunc(func(params todos.FindTodosParams) middleware.Responder { return middleware.NotImplemented("operation todos.FindTodos has not yet been implemented") }) return setupGlobalMiddleware(api.Serve(setupMiddlewares)) }
func configureAPI(api *operations.TaskTrackerAPI) http.Handler { // configure the api here api.ServeError = errors.ServeError api.JSONConsumer = httpkit.JSONConsumer() api.JSONProducer = httpkit.JSONProducer() api.APIKeyAuth = func(token string) (interface{}, error) { return nil, errors.NotImplemented("api key auth (api_key) token from query has not yet been implemented") } api.TokenHeaderAuth = func(token string) (interface{}, error) { return nil, errors.NotImplemented("api key auth (token_header) X-Token from header has not yet been implemented") } api.TasksAddCommentToTaskHandler = tasks.AddCommentToTaskHandlerFunc(func(params tasks.AddCommentToTaskParams, principal interface{}) middleware.Responder { return middleware.NotImplemented("operation tasks.AddCommentToTask has not yet been implemented") }) api.TasksCreateTaskHandler = tasks.CreateTaskHandlerFunc(func(params tasks.CreateTaskParams, principal interface{}) middleware.Responder { return middleware.NotImplemented("operation tasks.CreateTask has not yet been implemented") }) api.TasksDeleteTaskHandler = tasks.DeleteTaskHandlerFunc(func(params tasks.DeleteTaskParams, principal interface{}) middleware.Responder { return middleware.NotImplemented("operation tasks.DeleteTask has not yet been implemented") }) api.TasksGetTaskCommentsHandler = tasks.GetTaskCommentsHandlerFunc(func(params tasks.GetTaskCommentsParams) middleware.Responder { return middleware.NotImplemented("operation tasks.GetTaskComments has not yet been implemented") }) api.TasksGetTaskDetailsHandler = tasks.GetTaskDetailsHandlerFunc(func(params tasks.GetTaskDetailsParams) middleware.Responder { return middleware.NotImplemented("operation tasks.GetTaskDetails has not yet been implemented") }) api.TasksListTasksHandler = tasks.ListTasksHandlerFunc(func(params tasks.ListTasksParams) middleware.Responder { return middleware.NotImplemented("operation tasks.ListTasks has not yet been implemented") }) api.TasksUpdateTaskHandler = tasks.UpdateTaskHandlerFunc(func(params tasks.UpdateTaskParams, principal interface{}) middleware.Responder { return middleware.NotImplemented("operation tasks.UpdateTask has not yet been implemented") }) api.TasksUploadTaskFileHandler = tasks.UploadTaskFileHandlerFunc(func(params tasks.UploadTaskFileParams, principal interface{}) middleware.Responder { return middleware.NotImplemented("operation tasks.UploadTaskFile has not yet been implemented") }) api.ServerShutdown = func() {} // api.CommandLineOptionsGroups = []swag.CommandLineOptionsGroup{ ... } return setupGlobalMiddleware(api.Serve(setupMiddlewares)) }
func configureAPI(api *operations.PetstoreAPI) http.Handler { // configure the api here api.ServeError = errors.ServeError api.JSONConsumer = httpkit.JSONConsumer() api.XMLConsumer = httpkit.ConsumerFunc(func(r io.Reader, target interface{}) error { return errors.NotImplemented("xml consumer has not yet been implemented") }) api.JSONProducer = httpkit.JSONProducer() api.XMLProducer = httpkit.ProducerFunc(func(w io.Writer, data interface{}) error { return errors.NotImplemented("xml producer has not yet been implemented") }) api.APIKeyAuth = func(token string) (interface{}, error) { return nil, errors.NotImplemented("api key auth (api_key) api_key from header has not yet been implemented") } api.PetAddPetHandler = pet.AddPetHandlerFunc(func(params pet.AddPetParams, principal interface{}) middleware.Responder { return middleware.NotImplemented("operation pet.AddPet has not yet been implemented") }) api.UserCreateUserHandler = user.CreateUserHandlerFunc(func(params user.CreateUserParams) middleware.Responder { return middleware.NotImplemented("operation user.CreateUser has not yet been implemented") }) api.UserCreateUsersWithArrayInputHandler = user.CreateUsersWithArrayInputHandlerFunc(func(params user.CreateUsersWithArrayInputParams) middleware.Responder { return middleware.NotImplemented("operation user.CreateUsersWithArrayInput has not yet been implemented") }) api.UserCreateUsersWithListInputHandler = user.CreateUsersWithListInputHandlerFunc(func(params user.CreateUsersWithListInputParams) middleware.Responder { return middleware.NotImplemented("operation user.CreateUsersWithListInput has not yet been implemented") }) api.StoreDeleteOrderHandler = store.DeleteOrderHandlerFunc(func(params store.DeleteOrderParams) middleware.Responder { return middleware.NotImplemented("operation store.DeleteOrder has not yet been implemented") }) api.PetDeletePetHandler = pet.DeletePetHandlerFunc(func(params pet.DeletePetParams, principal interface{}) middleware.Responder { return middleware.NotImplemented("operation pet.DeletePet has not yet been implemented") }) api.UserDeleteUserHandler = user.DeleteUserHandlerFunc(func(params user.DeleteUserParams) middleware.Responder { return middleware.NotImplemented("operation user.DeleteUser has not yet been implemented") }) api.PetFindPetsByStatusHandler = pet.FindPetsByStatusHandlerFunc(func(params pet.FindPetsByStatusParams, principal interface{}) middleware.Responder { return middleware.NotImplemented("operation pet.FindPetsByStatus has not yet been implemented") }) api.PetFindPetsByTagsHandler = pet.FindPetsByTagsHandlerFunc(func(params pet.FindPetsByTagsParams, principal interface{}) middleware.Responder { return middleware.NotImplemented("operation pet.FindPetsByTags has not yet been implemented") }) api.StoreGetInventoryHandler = store.GetInventoryHandlerFunc(func(principal interface{}) middleware.Responder { return middleware.NotImplemented("operation store.GetInventory has not yet been implemented") }) api.StoreGetOrderByIDHandler = store.GetOrderByIDHandlerFunc(func(params store.GetOrderByIDParams) middleware.Responder { return middleware.NotImplemented("operation store.GetOrderByID has not yet been implemented") }) api.PetGetPetByIDHandler = pet.GetPetByIDHandlerFunc(func(params pet.GetPetByIDParams, principal interface{}) middleware.Responder { return middleware.NotImplemented("operation pet.GetPetByID has not yet been implemented") }) api.UserGetUserByNameHandler = user.GetUserByNameHandlerFunc(func(params user.GetUserByNameParams) middleware.Responder { return middleware.NotImplemented("operation user.GetUserByName has not yet been implemented") }) api.UserLoginUserHandler = user.LoginUserHandlerFunc(func(params user.LoginUserParams) middleware.Responder { return middleware.NotImplemented("operation user.LoginUser has not yet been implemented") }) api.UserLogoutUserHandler = user.LogoutUserHandlerFunc(func() middleware.Responder { return middleware.NotImplemented("operation user.LogoutUser has not yet been implemented") }) api.StorePlaceOrderHandler = store.PlaceOrderHandlerFunc(func(params store.PlaceOrderParams) middleware.Responder { return middleware.NotImplemented("operation store.PlaceOrder has not yet been implemented") }) api.PetUpdatePetHandler = pet.UpdatePetHandlerFunc(func(params pet.UpdatePetParams, principal interface{}) middleware.Responder { return middleware.NotImplemented("operation pet.UpdatePet has not yet been implemented") }) api.PetUpdatePetWithFormHandler = pet.UpdatePetWithFormHandlerFunc(func(params pet.UpdatePetWithFormParams, principal interface{}) middleware.Responder { return middleware.NotImplemented("operation pet.UpdatePetWithForm has not yet been implemented") }) api.UserUpdateUserHandler = user.UpdateUserHandlerFunc(func(params user.UpdateUserParams) middleware.Responder { return middleware.NotImplemented("operation user.UpdateUser has not yet been implemented") }) api.PetUploadFileHandler = pet.UploadFileHandlerFunc(func(params pet.UploadFileParams, principal interface{}) middleware.Responder { return middleware.NotImplemented("operation pet.UploadFile has not yet been implemented") }) api.ServerShutdown = func() {} // api.CommandLineOptionsGroups = []swag.CommandLineOptionsGroup{ ... } return setupGlobalMiddleware(api.Serve(setupMiddlewares)) }
func configureAPI(api *operations.GophergalaLearningResourcesAPI) http.Handler { // configure the api here api.ServeError = errors.ServeError api.JSONConsumer = httpkit.JSONConsumer() api.JSONProducer = httpkit.JSONProducer() api.AddLearningResourceHandler = operations.AddLearningResourceHandlerFunc(func(params operations.AddLearningResourceParams) middleware.Responder { if err := addLearningResource(params.LearningResource); err != nil { return operations.NewAddLearningResourceDefault(500).WithPayload(&models.ErrorModel{Code: 500, Message: err.Error()}) } return operations.NewAddLearningResourceOK().WithPayload(params.LearningResource) }) api.AddReviewHandler = operations.AddReviewHandlerFunc(func(params operations.AddReviewParams) middleware.Responder { err := db.AddReview(params.Review) if err != nil { return operations.NewAddReviewDefault(500).WithPayload(&models.ErrorModel{Code: 500, Message: err.Error()}) } return operations.NewAddReviewOK().WithPayload(params.Review) }) api.AddScreenshotHandler = operations.AddScreenshotHandlerFunc(func(params operations.AddScreenshotParams) middleware.Responder { err := db.AddScreenshot(¶ms) if err != nil { return operations.NewAddScreenshotDefault(500).WithPayload(&models.ErrorModel{Code: 500, Message: err.Error()}) } return operations.NewAddScreenshotOK() }) api.AddUserHandler = operations.AddUserHandlerFunc(func(params operations.AddUserParams) middleware.Responder { err := db.AddUser(params.User) if err != nil { return operations.NewAddUserDefault(500).WithPayload(&models.ErrorModel{Code: 500, Message: err.Error()}) } return operations.NewAddUserOK() }) api.AuthUserHandler = operations.AuthUserHandlerFunc(func(params operations.AuthUserParams) middleware.Responder { authed := db.AuthUser(params.User.Email, params.User.Password) if authed { return operations.NewAuthUserOK() } return operations.NewAuthUserDefault(403) }) api.DeleteLearningResourceHandler = operations.DeleteLearningResourceHandlerFunc(func(params operations.DeleteLearningResourceParams) middleware.Responder { err := db.DeleteLearningResource(params.ID) if err != nil { return operations.NewDeleteLearningResourceDefault(500).WithPayload(&models.ErrorModel{Code: 500, Message: err.Error()}) } return operations.NewDeleteLearningResourceNoContent() }) api.DeleteReviewHandler = operations.DeleteReviewHandlerFunc(func(params operations.DeleteReviewParams) middleware.Responder { return middleware.NotImplemented("operation .DeleteReview has not yet been implemented") }) api.DeleteUserHandler = operations.DeleteUserHandlerFunc(func(params operations.DeleteUserParams) middleware.Responder { return middleware.NotImplemented("operation .DeleteUser has not yet been implemented") }) api.FindLanguagesHandler = operations.FindLanguagesHandlerFunc(func() middleware.Responder { langs, err := db.FindLanguages() if err != nil { operations.NewFindLanguagesDefault(500).WithPayload(&models.ErrorModel{Code: 500, Message: err.Error()}) } ls := models.Languages{langs} return operations.NewFindLanguagesOK().WithPayload(&ls) }) api.FindLearningResourceByIDHandler = operations.FindLearningResourceByIDHandlerFunc(func(params operations.FindLearningResourceByIDParams) middleware.Responder { learningResource, err := db.FindLearningResourceByID(params.ID) if err != nil { return operations.NewFindLearningResourceByIDDefault(500).WithPayload(&models.ErrorModel{Code: 500, Message: err.Error()}) } return operations.NewFindLearningResourceByIDOK().WithPayload(learningResource) }) api.FindLearningResourcesHandler = operations.FindLearningResourcesHandlerFunc(func(params operations.FindLearningResourcesParams) middleware.Responder { learningResources := []*models.LearningResource{} var err error if len(params.Types) == 0 { learningResources, err = db.FindLearningResources("all") if err != nil { return operations.NewFindLearningResourcesDefault(500).WithPayload(&models.ErrorModel{Code: 500, Message: err.Error()}) } } for _, t := range params.Types { lr, err := db.FindLearningResources(t) if err != nil { return operations.NewFindLearningResourcesDefault(500).WithPayload(&models.ErrorModel{Code: 500, Message: err.Error()}) } learningResources = append(learningResources, lr...) } return operations.NewFindLearningResourcesOK().WithPayload(learningResources) }) api.FindReviewByIDHandler = operations.FindReviewByIDHandlerFunc(func(params operations.FindReviewByIDParams) middleware.Responder { return middleware.NotImplemented("operation .FindReviewByID has not yet been implemented") }) api.FindReviewsHandler = operations.FindReviewsHandlerFunc(func() middleware.Responder { return middleware.NotImplemented("operation .FindReviews has not yet been implemented") }) api.FindReviewsForLearningResourceHandler = operations.FindReviewsForLearningResourceHandlerFunc(func(params operations.FindReviewsForLearningResourceParams) middleware.Responder { reviews, err := db.FindReviewsForLearningResource(params.ID) if err != nil { return operations.NewFindReviewsForLearningResourceDefault(500).WithPayload(&models.ErrorModel{Code: 500, Message: err.Error()}) } return operations.NewFindReviewsForLearningResourceOK().WithPayload(reviews) }) api.FindRecommendationForLearningResourceHandler = operations.FindRecommendationForLearningResourceHandlerFunc(func(params operations.FindRecommendationForLearningResourceParams) middleware.Responder { return middleware.NotImplemented("operation .FindRecommendationForLearningResource has not yet been implemented") }) api.FindUserByIDHandler = operations.FindUserByIDHandlerFunc(func(params operations.FindUserByIDParams) middleware.Responder { return middleware.NotImplemented("operation .FindUserByID has not yet been implemented") }) api.ServerShutdown = func() {} // api.CommandLineOptionsGroups = []swag.CommandLineOptionsGroup{ ... } return setupGlobalMiddleware(api.Serve(setupMiddlewares)) }
// GetImageTar returns an image tar file func (handler *StorageHandlersImpl) GetImageTar(params storage.GetImageTarParams) middleware.Responder { return middleware.NotImplemented("operation storage.GetImageTar has not yet been implemented") }