presenter

package
v0.0.0-...-8ca6fb7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 2, 2018 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package presenter implements formatted usecase output.

Index

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"
}

func (*JSONPresenter) Call

func (p *JSONPresenter) Call(res proto.Message) (io.Reader, error)

func (*JSONPresenter) Describe

func (p *JSONPresenter) Describe(showable port.Showable) (io.Reader, error)

func (*JSONPresenter) Header

func (p *JSONPresenter) Header() (io.Reader, error)

func (*JSONPresenter) Package

func (p *JSONPresenter) Package() (io.Reader, error)

func (*JSONPresenter) Service

func (p *JSONPresenter) Service() (io.Reader, error)

func (*JSONPresenter) Show

func (p *JSONPresenter) Show(showable port.Showable) (io.Reader, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL