wybiral/hookah

Move API to instance

wybiral opened this issue · 1 comments

The new interface should look something like this:

  • h := hookah.New() creates a new instance of hookah
  • r, err := h.NewInput("proto://args") create a new input (ReadCloser)
  • w, err := h.NewOutput("proto://args") create a new output (WriteCloser)
  • h.RegisterInput("proto", handler) register input handler
  • h.RegisterOutput("proto", handler) register output handler

This will allow the current default handlers to all be registered the same way as user-defined ones and will make it easier to enumerate them (so they can be listed by the application).