Help us shape the future of Go! Take the 2026 Go Developer Survey

response

package
v0.6.5 Latest Latest
Warning

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

Go to latest
Published: May 25, 2021 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