utils

package
v0.0.0-...-eb69673 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2020 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const DateLayout string = "2006-01-02"
View Source
const DateTimeLayout string = "2006-01-02 15:04:05"
View Source
const DateTimeWithoutDashLayout = "20060102150405"
View Source
const EmptyString = ""

Variables

This section is empty.

Functions

func All

func All(array interface{}, predicate interface{}) bool

func Any

func Any(array interface{}, predicate interface{}) bool

func AnyError

func AnyError(array interface{}, predicate func(index int, value interface{}) error) (error, int, interface{})

func Cast

func Cast(array interface{}, castReceiver interface{})

func Compare

func Compare(left, right *string, ignoreCase bool) int

func Copy

func Copy(src, dest string) error

Copy copies src to dest, doesn't matter if src is a directory or a file

func CopyMap

func CopyMap(a interface{}) interface{}

func Date

func Date(date string) (time.Time, error)

func Datetime

func Datetime(t string) (time.Time, error)

func Diff

func Diff(expected interface{}, actual interface{}) string

func DirectoryExists

func DirectoryExists(path string) bool

func EmptyArray

func EmptyArray(array interface{}) bool

func EmptyOrWhiteSpace

func EmptyOrWhiteSpace(text interface{}) bool

func EnsureDirectory

func EnsureDirectory(path string, createIfNotExists bool) error

func EqualValues

func EqualValues(expected, actual interface{}) (bool, string)

func FileExists

func FileExists(path string) bool

func FirstDayOfMonth

func FirstDayOfMonth(t time.Time) time.Time

func FirstOrDefault

func FirstOrDefault(array interface{}, predicate interface{}) (interface{}, bool)

func FormatValue

func FormatValue(value interface{}) string

func IsEmptyFolder

func IsEmptyFolder(name string) (bool, error)

func MapKeys

func MapKeys(a interface{}) interface{}

func MapValues

func MapValues(a interface{}) interface{}

func NormalizeDate

func NormalizeDate(t time.Time) time.Time

func ParseDate

func ParseDate(dateString string, defaultDate time.Time) time.Time

func ParseValue

func ParseValue(value interface{}, stringValue string) (err error)

func Ptr2Str

func Ptr2Str(text *string) (string, bool)

func ReverseTimeStamp

func ReverseTimeStamp(timestamp string) string

func Select

func Select(array interface{}, selector interface{}) interface{}

func SelectWithIndex

func SelectWithIndex(array interface{}, selector interface{}) interface{}

func StrPtr2Ptr

func StrPtr2Ptr(getter func() (string, bool)) *string

func ToDateString

func ToDateString(t time.Time) string

func ToDatetimeString

func ToDatetimeString(t time.Time) string

func ToDatetimeStringWithoutDash

func ToDatetimeStringWithoutDash(t time.Time) string

func Where

func Where(array interface{}, predicate interface{}) interface{}

func WhereInMapValues

func WhereInMapValues(m interface{}, predicate interface{}) interface{}

Types

This section is empty.

Jump to

Keyboard shortcuts

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