packagemainimport ("fmt""net/http""github.com/go-chi/chi""github.com/go-chi/chi/middleware""github.com/alexisvisco/kcd")funcmain() { r := chi.NewRouter() r.Use(middleware.RequestID)// You can configure kcd with kcd.Config r.Get("/{name}", kcd.Handler(YourHttpHandler, http.StatusOK))// ^ Here the magic happen this is the only thing you need// to do. Adding kcd.Handler(your handler) _ = http.ListenAndServe(":3000", r)}// CreateCustomerInput is an example of input for an http request.typeCreateCustomerInputstruct { Name string`path:"name"`// you can extract value from: 'path', 'query', 'header', 'ctx' Emails []string`query:"emails" exploder:","`// exploder (is optional) split value with the characters specified Subject string`json:"body"`// it also works with json body}// CustomerOutput is the output type of the http request.typeCreateCustomerOutputstruct { Name string`json:"name"`}// YourHttpHandler is your http handler but in a shiny version.// You can add *http.ResponseWriter or http.Request in params if you want.// funcYourHttpHandler(in *CreateCustomerInput) (CreateCustomerOutput, error) {// do some stuff here fmt.Printf("%+v", in)returnCreateCustomerOutput{Name: in.Name}, nil}