util

package
v2.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BasicAuthHeaderValue

func BasicAuthHeaderValue(username, password string) string

func CreateDirectory

func CreateDirectory(dir string) (err error)

func CutBytes

func CutBytes(s, sep []byte) (before, after []byte, found bool)

CutBytes slices s around the first instance of sep, returning the text before and after sep. The found result reports whether sep appears in s. If sep does not appear in s, cut returns s, nil, false.

CutBytes returns slices of the original slice s, not copies.

func CutString

func CutString(s, sep string) (before, after string, found bool)

CutString slices s around the first instance of sep, returning the text before and after sep. The found result reports whether sep appears in s. If sep does not appear in s, cut returns s, "", false.

func FirstNonEmpty

func FirstNonEmpty(v ...string) string

func GetPointer

func GetPointer(v interface{}) interface{}

func IsJSONType

func IsJSONType(ct string) bool

IsJSONType method is to check JSON content type or not

func IsStringEmpty

func IsStringEmpty(str string) bool

IsStringEmpty method tells whether given string is empty or not

func IsXMLType

func IsXMLType(ct string) bool

IsXMLType method is to check XML content type or not

Types

This section is empty.

Jump to

Keyboard shortcuts

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