utils

package
v0.0.0-...-2ac6bf7 Latest Latest
Warning

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

Go to latest
Published: May 13, 2016 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Extend

func Extend(dest interface{}, src interface{}) interface{}

Extend copies non-zero values from src to dest

It returns dest

func MapFromStructTag

func MapFromStructTag(src interface{}, tagName string, dest ...map[string]interface{}) map[string]interface{}

MapFromStructTag builds a hash map using the string specified by tagName as the keys

If dest is specified, it will be used as the map where the result is stored. Otherwise a new map will be initialized and returned.

Optionally omitempty may be added to the value to cause a zero value of the field to be omitted from the map entirely

func ToIOReadCloser

func ToIOReadCloser(input interface{}) (io.ReadCloser, error)

ToIOReadCloser converts the specified input to an IOReadCloser.

If it cannot be converted, an error will be returned. If the interface is an IOReader and does not implement a Close method, a NoOp close method will be added

func ToIOReader

func ToIOReader(input interface{}) (io.Reader, error)

ToIOReader converts the specified input to an IOReader

Types

This section is empty.

Jump to

Keyboard shortcuts

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