Documentation
¶
Overview ¶
Package assets is a set of different useful functions for everyday use.
Index ¶
- func Byte2Bytes(num byte) []byte
- func Byte2String(num byte) string
- func Bytes2Byte(input []byte) (byte, error)
- func Bytes2Uint16(input []byte) (uint16, error)
- func Bytes2Uint32(input []byte) (uint32, error)
- func CheckName(name string) bool
- func Date(year, day int, month time.Month) time.Time
- func Days(month time.Time) int
- func GenPassword(length byte) string
- func GenPasswordAsBytes(length byte) []byte
- func GetRandomByte(max byte) byte
- func IsCyrillicString(company string) bool
- func IsEmailValid(email string) bool
- func MultipleEqual(booleans ...bool) (bool, error)
- func RemoveSafeQM(str string) string
- func SafeQM(str string) string
- func SaveFile(data interface{}, path string) error
- func SetByte(inputByte *byte, inputString string) bool
- func SetUint16(inputByte *uint16, inputString string) bool
- func SetUint32(inputUint32 *uint32, inputString string) bool
- func String2Bool(inputString string) bool
- func String2Byte(input string) (byte, error)
- func String2Uint16(input string) (uint16, error)
- func String2Uint32(input string) (uint32, error)
- func Uint162Bytes(num uint16) []byte
- func Uint162String(num uint16) string
- type IntError
- type String
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Byte2Bytes ¶ added in v1.0.8
Byte2Bytes converts a byte number to []byte.
func Byte2String ¶ added in v1.0.9
Byte2String converts a byte number to string.
func Bytes2Byte ¶ added in v1.0.11
Bytes2Byte checks and converts input string as []byte to byte type.
func Bytes2Uint16 ¶ added in v1.0.12
Bytes2Uint16 checks and converts input string as []byte to uint16 type.
func Bytes2Uint32 ¶ added in v1.0.11
Bytes2Uint32 checks and converts input string as []byte to uint32 type.
func GenPassword ¶
GenPassword generates a password of a set length.
func GenPasswordAsBytes ¶ added in v1.2.0
GenPasswordAsBytes generates a password of a set length.
func GetRandomByte ¶ added in v1.0.3
GetRandomByte generates a random byte number.
func IsCyrillicString ¶ added in v1.4.0
IsCyrillicString check if an only allowed set of symbols is in the company name.
func IsEmailValid ¶ added in v1.0.7
IsEmailValid checks if the input email is valid.
func MultipleEqual ¶
MultipleEqual checks all the bool parameters and returns a result.
func RemoveSafeQM ¶
RemoveSafeQM removes symbols '\' before quotation marks.
func String2Bool ¶ added in v1.1.0
String2Bool converts input string to bool type.
func String2Byte ¶ added in v1.0.11
String2Byte checks and converts input string to byte type.
func String2Uint16 ¶ added in v1.0.12
String2Uint16 checks and converts input string to uint16 type.
func String2Uint32 ¶ added in v1.0.11
String2Uint32 checks and converts input string to uint32 type.
func Uint162Bytes ¶ added in v1.0.8
Uint162Bytes converts an uint16 number to string.
func Uint162String ¶ added in v1.0.10
Uint162String converts an uint16 number to string.
Types ¶
type String ¶
String is an extended version of string type
func HTTPString ¶
HTTPString removes all leading and trailing white space and replace quotation marks with "
func (*String) SetStringByPointer ¶
SetStringByPointer checks and sets input Strings parameter to a string through a pointer.