response

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

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

Go to latest
Published: Jun 29, 2018 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Create

func Create(data interface{}, err interface{}) peer.Response

Create returns peer.Response (Success or Error) depending on value of err if err is (bool) false or is error interface - returns shim.Error

func Error

func Error(err interface{}) peer.Response

Error returns shim.Error

func Success

func Success(data interface{}) peer.Response

Success returns shim.Success with serialized json if necessary

Types

type Transformer

type Transformer struct {
	// contains filtered or unexported fields
}

Transformer type transforms data

func Transform

func Transform(data interface{}, err error) *Transformer

Transform creates Transformer struct

func (Transformer) With

func (t Transformer) With(transfomer func(interface{}) interface{}) peer.Response

With func transformer

Jump to

Keyboard shortcuts

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