Documentation ¶
Overview ¶
codeutils project codeutils.go See doc.go
codeutils document
Updated Dec 2024 v1.0.30
Index ¶
- Constants
- func DateToStr(adate time.Time) (result string)
- func DecryptText(password, encodedCiphertext string) (string, error)
- func EncryptText(password, plaintext string) (string, error)
- func FormatCommas(num int32) (formatedNum string)
- func FormatFloatCommas(num float64, digits int) (formatedNum string)
- func FormatFloatCommasTrim(num float64, digits int) (formatedNum string)
- func GetConfigValue(configFile, name string) (value string)
- func GetConfigValueWithError(configFile, name string) (value string, err error)
- func GetConfigWithDefault(configFile, name, defaultValue string) (value string)
- func GetCurrentAppDir() string
- func GetMD5(text string) string
- func GetRandom(r int) int
- func GetRemoteIP(r *http.Request) (ip string)
- func IsFileExists(fileName string) (exists bool)
- func PrepareURLCall(url string, method string, content []byte) (req *http.Request, err error)
- func ReadINIAsBool(filename, section, key string) (value bool, err error)
- func ReadINIAsInt(filename, section, key string) (value int, err error)
- func ReadINISections(filename string) (sections []string, err error)
- func ReadINISectionsKeys(filename, section string) (keys []string, err error)
- func ReadINIValue(filename, section, key, defaultValue string) (value string, err error)
- func SetConfigValue(configFile, name string, value string) (success bool)
- func SetHeaderAuthentication(req *http.Request, username, password string)
- func SetIniValue(filename, section, key, value string) error
- func SetLogType(alogtype byte)
- func SetURLHeaders(req *http.Request, headers map[string]string)
- func SkipHTTPSVerfication()
- func StrToDate(dateStr string) (dateResult time.Time, err error)
- func StrToTime(timeStr string) (timeResult time.Time, err error)
- func TimeToStr(atime time.Time) (result string)
- func WriteToLog(event string, logFileName string) (err error)
- type CallURLResult
Constants ¶
View Source
const HOURLYLOG = 2
View Source
const MONTHLYLOG = 0
View Source
const WEEKLYLOG = 1
Variables ¶
This section is empty.
Functions ¶
func DecryptText ¶ added in v1.0.22
DecryptText decrypts concatenated chunks and reassembles the plaintext.
func EncryptText ¶ added in v1.0.22
encryptText encrypts the entire text in chunks and concatenates the results.
func FormatCommas ¶ added in v1.0.13
func FormatFloatCommas ¶ added in v1.0.18
func FormatFloatCommasTrim ¶ added in v1.0.30
func GetConfigValue ¶
func GetConfigValueWithError ¶
func GetConfigWithDefault ¶ added in v1.0.25
func GetCurrentAppDir ¶
func GetCurrentAppDir() string
GetCurrentAppDir returns path from application running directory
func GetRemoteIP ¶ added in v1.0.10
func IsFileExists ¶
func PrepareURLCall ¶ added in v1.0.13
func ReadINIAsBool ¶ added in v1.0.27
func ReadINIAsInt ¶ added in v1.0.27
func ReadINISections ¶ added in v1.0.27
func ReadINISectionsKeys ¶ added in v1.0.27
func ReadINIValue ¶ added in v1.0.27
func SetConfigValue ¶
func SetHeaderAuthentication ¶ added in v1.0.13
func SetIniValue ¶ added in v1.0.31
func SetLogType ¶ added in v1.0.6
func SetLogType(alogtype byte)
func SetURLHeaders ¶ added in v1.0.13
func SkipHTTPSVerfication ¶ added in v1.0.13
func SkipHTTPSVerfication()
func WriteToLog ¶
WriteToLog write to log file
Types ¶
type CallURLResult ¶ added in v1.0.14
func CallURL ¶ added in v1.0.13
func CallURL(req *http.Request, timeoutSec int) (result CallURLResult)
func CallURLAsGet ¶ added in v1.0.13
func CallURLAsGet(url string, timeoutSec int) (result CallURLResult)
func CallURLAsPost ¶ added in v1.0.13
func CallURLAsPost(url string, contents []byte, timeoutSec int) (result CallURLResult)
Click to show internal directories.
Click to hide internal directories.