rcrowley / go-tigertonic

A Go framework for building JSON web services inspired by Dropwizard

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CSV output

rcrowley opened this issue · comments

http://golang.org/pkg/encoding/csv/ is a reasonable interface that would be easy to wrap around an http.ResponseWriter. This would be extremely easy for GET requests but it'd be nice to reuse the Marshaler code for JSON POST requests.

@matterkkila let's talk about how you want to use it and whether you will even need POST responses as CSV.

@rcrowley how would you feel about Marshaler implementing various encoders based on the Accept header? encoding/xml for example provides a very similar interface to encoding/json.

In general, it doesn't seem like it'd be very difficult to get the Marshaler to support various formats

I'd rather not complicate the code and I'm comfortable with the fact that that means you'd have to write your own http.Handler to deal with XML. I'm sorry.