format

package
v0.0.0-...-cbc3a0c Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2018 License: Apache-2.0 Imports: 11 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CamelToSnake

func CamelToSnake(s string) string

CamelToSnake translate camel case to snake case.

func CheckPath

func CheckPath(fieldMask *types.FieldMask, path []string) bool

CheckPath check if fieldMask includes provided path.

func ContainsString

func ContainsString(list []string, a string) bool

ContainsString check if a string is in a string list.

func GetUUIDFromInterface

func GetUUIDFromInterface(rawProperties interface{}) (string, error)

GetUUIDFromInterface get a UUID from an interface.

func GetValueByPath

func GetValueByPath(dataSource map[string]interface{}, path string, delimiter string) (value interface{}, ok bool)

GetValueByPath method returns the value for the given path form the nested map. The path currently does not support array index.

func InterfaceToBool

func InterfaceToBool(i interface{}) bool

InterfaceToBool makes a bool from interface

func InterfaceToBytes

func InterfaceToBytes(i interface{}) []byte

InterfaceToBytes makes a bytes from interface

func InterfaceToFloat

func InterfaceToFloat(i interface{}) float64

InterfaceToFloat makes a float.

func InterfaceToInt

func InterfaceToInt(i interface{}) int

InterfaceToInt makes an int from interface

func InterfaceToInt64

func InterfaceToInt64(i interface{}) int64

InterfaceToInt64 makes an int64 from interface

func InterfaceToInt64List

func InterfaceToInt64List(i interface{}) []int64

InterfaceToInt64List makes a int64 list from interface

func InterfaceToInterfaceList

func InterfaceToInterfaceList(i interface{}) []interface{}

InterfaceToInterfaceList makes a interface list from interface

func InterfaceToInterfaceMap

func InterfaceToInterfaceMap(i interface{}) map[string]interface{}

InterfaceToInterfaceMap makes a interface map.

func InterfaceToString

func InterfaceToString(i interface{}) string

InterfaceToString makes a string from interface

func InterfaceToStringList

func InterfaceToStringList(i interface{}) []string

InterfaceToStringList makes a string list from interface

func InterfaceToStringMap

func InterfaceToStringMap(i interface{}) map[string]string

InterfaceToStringMap makes a string map.

func InterfaceToUint64

func InterfaceToUint64(i interface{}) uint64

InterfaceToUint64 makes an uint64 from interface

func MustJSON

func MustJSON(data interface{}) string

MustJSON Marshal json

func MustYAML

func MustYAML(data interface{}) string

MustYAML returns YAML-encoded data.

func RemoveFromStringSlice

func RemoveFromStringSlice(slice []string, values map[string]struct{}) []string

RemoveFromStringSlice removes given values from slice of strings. It preserves order of values.

func SetValueByPath

func SetValueByPath(dataSource map[string]interface{}, path string, delimiter string, value interface{}) (ok bool)

SetValueByPath method set the value for the given path in the nested map. The path currently does not support slice item assignment.

func SnakeToCamel

func SnakeToCamel(s string) string

SnakeToCamel translates snake case to camel case.

Types

This section is empty.

Jump to

Keyboard shortcuts

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