util

package
v0.1.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	StackFilterKeyForGoFrame = "/github.com/gogf/gf/" // Stack filtering key for all GoFrame module paths.
)

Variables

This section is empty.

Functions

func EqualFoldWithoutChars

func EqualFoldWithoutChars(s1, s2 string) bool

EqualFoldWithoutChars checks string <s1> and <s2> equal case-insensitively, with/without chars '-'/'_'/'.'/' '.

func IsArray

func IsArray(value interface{}) bool

IsArray checks whether given value is array/slice. Note that it uses reflect internally implementing this feature.

func IsDebugEnabled

func IsDebugEnabled() bool

IsDebugEnabled checks and returns whether debug mode is enabled. The debug mode is enabled when command argument "gf.debug" or environment "GF_DEBUG" is passed.

func IsLetter

func IsLetter(b byte) bool

IsLetter checks whether the given byte b is a letter.

func IsLetterLower

func IsLetterLower(b byte) bool

IsLetterLower checks whether the given byte b is in lower case.

func IsLetterUpper

func IsLetterUpper(b byte) bool

IsLetterUpper checks whether the given byte b is in upper case.

func IsNumeric

func IsNumeric(s string) bool

IsNumeric checks whether the given string s is numeric. Note that float string like "123.456" is also numeric.

func NewReadCloser

func NewReadCloser(content []byte, repeatable bool) io.ReadCloser

NewRepeatReadCloser creates and returns a RepeatReadCloser object.

func NewReadCloserWithReadCloser

func NewReadCloserWithReadCloser(r io.ReadCloser, repeatable bool) (io.ReadCloser, error)

NewRepeatReadCloserWithReadCloser creates and returns a RepeatReadCloser object with given io.ReadCloser.

func RemoveSymbols

func RemoveSymbols(s string) string

RemoveSymbols removes all symbols from string and lefts only numbers and letters.

func ReplaceByMap

func ReplaceByMap(origin string, replaces map[string]string) string

ReplaceByMap returns a copy of <origin>, which is replaced by a map in unordered way, case-sensitively.

func UcFirst

func UcFirst(s string) string

UcFirst returns a copy of the string s with the first letter mapped to its upper case.

Types

type ReadCloser

type ReadCloser struct {
	// contains filtered or unexported fields
}

ReadCloser implements the io.ReadCloser interface which is used for reading request body content multiple times.

Note that it cannot be closed.

func (*ReadCloser) Close

func (b *ReadCloser) Close() error

Close implements the io.ReadCloser interface.

func (*ReadCloser) Read

func (b *ReadCloser) Read(p []byte) (n int, err error)

Read implements the io.ReadCloser interface.

Directories

Path Synopsis
Package gmode provides release mode management for project.
Package gmode provides release mode management for project.
Package gpage provides useful paging functionality for web pages.
Package gpage provides useful paging functionality for web pages.
Package grand provides high performance random bytes/number/string generation functionality.
Package grand provides high performance random bytes/number/string generation functionality.
Package guid provides simple and high performance unique id generation functionality.
Package guid provides simple and high performance unique id generation functionality.
Package gutil provides utility functions.
Package gutil provides utility functions.
Package gvalid implements powerful and useful data/form validation functionality.
Package gvalid implements powerful and useful data/form validation functionality.

Jump to

Keyboard shortcuts

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