Documentation
¶
Index ¶
- Constants
- Variables
- func CensorString(str string) string
- func Copy(toValue interface{}, fromValue interface{}) (err error)
- func CopyWithOption(toValue interface{}, fromValue interface{}, opt Option) (err error)
- func CreateFolderIfNotExists(path string) error
- func DownloadFileByUrl(link string, localPath string) (string, string, error)
- func GenerateAddress(secretKey string) (string, string, error)
- func GenerateSolanaAddress(secretKey string) (string, string, error)
- func GetBalanceOnSolanaChain(ctx context.Context, address string) (*big.Int, error)
- func IsBase64DataURL(urlStr string) bool
- func IsEnvProduction(env string) bool
- func IsStringEmpty(s string) bool
- func IsStringNotEmpty(s string) bool
- func MinifyHTML(html string) (string, error)
- func ResolveURL(base, ref string) (string, error)
- func StringTrimSpace(s string) string
- type Environment
- type FieldNameMapping
- type Option
- type TypeConverter
Constants ¶
View Source
const ( // Some default converter types for a nicer syntax String string = "" Bool bool = false Int int = 0 Float32 float32 = 0 Float64 float64 = 0 )
These flags define options for tag handling
View Source
const ( UndefinedString = "undefined" ZeroString = "" CensorStringValue = "***" )
Variables ¶
View Source
var ( ErrInvalidCopyDestination = errors.New("copy destination must be non-nil and addressable") ErrInvalidCopyFrom = errors.New("copy from must be non-nil and addressable") ErrMapKeyNotMatch = errors.New("map's key type doesn't match") ErrNotSupported = errors.New("not supported") ErrFieldNameTagStartNotUpperCase = errors.New("copier field name tag must be start upper case") )
Functions ¶
func CopyWithOption ¶
CopyWithOption copy with option
func CreateFolderIfNotExists ¶
func DownloadFileByUrl ¶
func GenerateAddress ¶
return encryptedPrivateKeyKey, address, error
func GetBalanceOnSolanaChain ¶
func IsBase64DataURL ¶
func IsEnvProduction ¶
func IsStringNotEmpty ¶
IsStringNotEmpty -- check if string is not empty
func MinifyHTML ¶
func ResolveURL ¶
func StringTrimSpace ¶
StringTrimSpace -- trim space of string
Types ¶
type FieldNameMapping ¶
type Option ¶
type Option struct { // setting this value to true will ignore copying zero values of all the fields, including bools, as well as a // struct having all it's fields set to their zero values respectively (see IsZero() in reflect/value.go) IgnoreEmpty bool CaseSensitive bool DeepCopy bool Converters []TypeConverter // Custom field name mappings to copy values with different names in `fromValue` and `toValue` types. // Examples can be found at `TestCustomFieldName`. FieldNameMapping []FieldNameMapping }
Option sets copy options
type TypeConverter ¶
type TypeConverter struct { SrcType interface{} DstType interface{} Fn func(src interface{}) (dst interface{}, err error) }
Click to show internal directories.
Click to hide internal directories.