utils

package
v1.0.8 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Contains

func Contains(a []string, x string) bool

Contains checks if string array contains string

func ExtractStringSlice

func ExtractStringSlice(values []interface{}) []string

ExtractStringSlice gets string slice from interface

func GetBoolValue

func GetBoolValue(data map[string]interface{}, param string, def *bool) *bool

GetBoolValue from interface

func GetBoolValueFromString

func GetBoolValueFromString(value string, defaultValue bool) *bool

GetBoolValueFromString from interface

func GetFloat64Value

func GetFloat64Value(data map[string]interface{}, param string, def *float64) *float64

GetFloat64Value from interface

func GetIntValue

func GetIntValue(data map[string]interface{}, param string, def int) int

GetIntValue from interface

func GetIntValueFromString

func GetIntValueFromString(value string, defaultValue int) *int

GetIntValueFromString from interface

func GetJSON

func GetJSON(url string, cookies ...*http.Cookie) map[string]interface{}

GetJSON downloads contents of url and returns json representation by unmarshal result

func GetJSONFix

func GetJSONFix(url string, cookies ...*http.Cookie) map[string]interface{}

GetJSONFix downloads contents of url and returns json representation by unmarshal result

func GetJSONUserAgent

func GetJSONUserAgent(url string, userAgent *string, cookies ...*http.Cookie) map[string]interface{}

GetJSONUserAgent downloads contents of url and returns json representation by unmarshal result

func GetMapValue

func GetMapValue(data map[string]interface{}, param string) *map[string]interface{}

GetMapValue returns Map from Map

func GetStringValue

func GetStringValue(data map[string]interface{}, param string, def *string) *string

GetStringValue from interface

func GetTimeFromString

func GetTimeFromString(str string, layouts ...string) *time.Time

GetTimeFromString from string

func Min

func Min(x, y int) int

Min of two ints

func Quote

func Quote(s string) string

Quote string for url use

Types

This section is empty.

Jump to

Keyboard shortcuts

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