util

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TagName = "json" //json tag
)

Json TagName

Variables

This section is empty.

Functions

func BuildCommandURL

func BuildCommandURL(f interface{}) string

BuildCommandURL creates the rest url depending the given command options (interface)

func Check

func Check(errorList *[]string, isValid bool, errMsg string, args ...interface{})

Check can be used for the validation of any expression which returns a boolean (isValid) Example: Check(&myErrorList, x.Y >= 0, "want positive Y, got %d", x.Y)

func Contains added in v0.0.2

func Contains(str string, list []string) bool

Contains tests if an array contains a certain value, Spaces will be trimed

func SetValueIfTagExists

func SetValueIfTagExists(f interface{}, actTag string, setVal string)

SetValueIfTagExists set a value if a given "json" tag exists in the given interface

func TagExists

func TagExists(f interface{}, actTag string) bool

TagExists checks if a given "json" tag exists in the given interface

func ValidateSingleChar

func ValidateSingleChar(input string) bool

ValidateSingleChar validates a string if containing only a single char

Types

This section is empty.

Jump to

Keyboard shortcuts

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