util

package
v3.0.0-...-dc1287f Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BasicAuthHeaderValue

func BasicAuthHeaderValue(username, password string) string

BasicAuthHeaderValue return the header of basic auth.

func CreateDirectory

func CreateDirectory(dir string) (err error)

CreateDirectory create the directory.

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 GetPointer

func GetPointer(v interface{}) interface{}

GetPointer return the pointer of the interface.

func GetType

func GetType(v interface{}) reflect.Type

GetType return the underlying type.

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