Documentation ¶
Index ¶
- Constants
- func BinToDec(b string) string
- func BinToHex(b string) string
- func BinToOct(b string) string
- func Camel(s string) string
- func DecToBin(b string) string
- func DecToHex(b string) string
- func DecToOct(d string) string
- func Download(url, dataDir string) (string, error)
- func Hashtag(s string) string
- func HexToBin(b string) string
- func HexToDec(b string) string
- func HexToOct(b string) string
- func ImageEncode(image string) (string, string, error)
- func JWTdecode(tokenString string) (*jwt.Token, error)
- func MD5(input string) string
- func OctToBin(b string) string
- func OctToDec(b string) string
- func OctToHex(b string) string
- func Pascal(s string) string
- func SHA1(input string) string
- func SHA256(input string) string
- func SHA512(input string) string
- func Sentence(s string) string
- func TimeDuration(diff time.Duration) string
- type Case
- type ChangeCase
- type ChangeCaseFn
- type ChangeCaser
- type CheckSum
- type CheckSumer
- type Decode
- type Decoder
- type Encode
- type Encoder
- type JSONFormat
- type JSONFormater
Constants ¶
View Source
const ( Minute = 60 Hour = 60 * Minute Day = 24 * Hour Week = 7 * Day // https://www.unixtimestamp.com // https://www.jotform.com/help/443-mastering-date-and-time-calculation/ Month = 2629743 // 30.44 days Year = 31556926 // 365.24 days LongTime = 37 * Year )
Variables ¶
This section is empty.
Functions ¶
func Camel ¶ added in v1.7.3
Camel converts a string to a string with the separators denoted by having the next letter capitalized
func Hashtag ¶ added in v1.7.3
Hashtag converts a string to a space separated string with hashtag symbols
func Sentence ¶ added in v1.7.3
Sentence converts a string to a lower case, space separated string with the first character upper case
func TimeDuration ¶ added in v1.5.0
Types ¶
type Case ¶ added in v1.7.3
type Case struct {
// contains filtered or unexported fields
}
func NewCase ¶ added in v1.7.3
func NewCase(fn ChangeCaseFn, sub string) *Case
type ChangeCase ¶ added in v1.7.3
type ChangeCase struct { Camel ChangeCaser Pascal ChangeCaser Constant ChangeCaser Dot ChangeCaser Lower ChangeCaser Lcfirst ChangeCaser No ChangeCaser Param ChangeCaser Path ChangeCaser Sentence ChangeCaser Snake ChangeCaser Swap ChangeCaser Title ChangeCaser Upper ChangeCaser Ucfirst ChangeCaser Hashtag ChangeCaser }
func NewChangeCase ¶ added in v1.7.3
func NewChangeCase() *ChangeCase
func (*ChangeCase) Get ¶ added in v1.7.3
func (c *ChangeCase) Get(input string) ChangeCaser
Get returns the ChangeCaser for the given input name
type ChangeCaseFn ¶ added in v1.7.3
type ChangeCaser ¶ added in v1.7.3
type CheckSumer ¶
func NewCheckSum ¶
func NewCheckSum(file string) (CheckSumer, error)
type Decoder ¶
type Decoder interface { Base64(input string) string URL(input string) string HTML(input string) string }
func NewDecoder ¶
func NewDecoder() Decoder
type Encoder ¶
type Encoder interface { Base64(input string) string URL(input string) string HTML(input string) string }
func NewEncoder ¶
func NewEncoder() Encoder
type JSONFormat ¶ added in v1.2.0
type JSONFormat struct { }
func (*JSONFormat) FourSpacesIndent ¶ added in v1.2.0
func (j *JSONFormat) FourSpacesIndent(s string) string
func (*JSONFormat) IsJSON ¶ added in v1.2.0
func (j *JSONFormat) IsJSON(s string) bool
func (*JSONFormat) Minify ¶ added in v1.2.0
func (j *JSONFormat) Minify(s string) string
func (*JSONFormat) TabIndent ¶ added in v1.2.0
func (j *JSONFormat) TabIndent(s string) string
func (*JSONFormat) TwoSpacesIndent ¶ added in v1.2.0
func (j *JSONFormat) TwoSpacesIndent(s string) string
type JSONFormater ¶ added in v1.2.0
type JSONFormater interface { TabIndent(string) string TwoSpacesIndent(string) string FourSpacesIndent(string) string Minify(string) string IsJSON(string) bool }
func NewJSONFormat ¶ added in v1.2.0
func NewJSONFormat() JSONFormater
Click to show internal directories.
Click to hide internal directories.