kcd
  • KCD ? What is that
  • Getting started
  • Handler
    • The magic behind kcd.Handler
    • How to use kcd.Handler
  • concepts
    • Handler
    • Input
    • Output
    • Hooks
    • Extractors
  • Input
    • Supported field types
    • Bind from body json
    • Bind path parameter
    • Bind query parameter
    • Bind context values
    • Bind header values
    • Default value
    • Validation
    • Exploder for slices
    • Nested fields and path system
    • Custom unmarshal (json, binary, text)
  • output
    • Returning JSON response
    • Errors
      • Throw special http status code
  • hooks & extractors
    • Override a default hook
    • Error hook
    • Render hook
    • Bind hook
    • Validate hook
    • Log hook
    • String extractor
    • Value extractor
  • Real world use case
    • Pagination
    • Conditionally render your outputs
  • Compatible with
    • Compatible with ?
    • Compatible with chi
    • Compatible with gin
    • Compatible with gorilla/mux
    • Compatible with echo
    • Compatible with the standard library
Powered by GitBook
On this page
  • So what's KCD ?
  • Is it painful to write your API in go?

Was this helpful?

KCD ? What is that

NextGetting started

Last updated 4 years ago

Was this helpful?

So what's KCD ?

KCD is not a framework, it's not a router. KCD is a helper that simplifies your life for building maintainable and comprehensive REST applications.

Its goal is to provide a way to write a beautiful handler without a boilerplate and translate it into a plain old HTTP handler.

This library is opinionated by default but customizable which means it uses some other libraries like Chi, Logrus... KCD is modular so each piece of the code that relies on a specific library can be changed.

Is it painful to write your API in go?

What's the problem when you are building an API in Golang? You know the classic:

  • Input marshaling from JSON

  • Input from query parameters

  • Input from path parameters

  • Input validation

  • Error handling

  • Error logging

  • Format response

All this kind of stuff is boring and when you come from an established language like Java, PHP, Ruby each of these languages has its own framework with a battle-tested solution to handle all of the cases above.

May change your code a bit ...