Documentation ¶
Overview ¶
Package presenter implements formatted usecase output.
Index ¶
- type JSONPresenter
- func (p *JSONPresenter) Call(res proto.Message) (io.Reader, error)
- func (p *JSONPresenter) Describe(showable port.Showable) (io.Reader, error)
- func (p *JSONPresenter) Header() (io.Reader, error)
- func (p *JSONPresenter) Package() (io.Reader, error)
- func (p *JSONPresenter) Service() (io.Reader, error)
- func (p *JSONPresenter) Show(showable port.Showable) (io.Reader, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type JSONPresenter ¶
type JSONPresenter struct {
// contains filtered or unexported fields
}
JSONPresenter provides JSON formatted output. For example, a message definition is here.
message { string foo = 1; }
If `foo` is "some_string", the response is
{"foo":"some_string"}
Also indenting is supported. (see NewJSONWithIndent)
func NewJSON ¶
func NewJSON() *JSONPresenter
func NewJSONWithIndent ¶
func NewJSONWithIndent() *JSONPresenter
NewJSONWithIndent provides indented output.
If `foo` is "some_string", the response is
{ "foo": "some_string" }
Click to show internal directories.
Click to hide internal directories.