Documentation
¶
Index ¶
- Constants
- Variables
- func AnonymizeIp(ip []byte) []byte
- func CopyBytes(input []byte) []byte
- func CreateDirectory(path string, perm fs.FileMode) (string, error)
- func CreateDirectoryFromFile(path string, perm fs.FileMode) (string, error)
- func CreateFile(path string, flags int, dirMode, mode fs.FileMode) (file *os.File, err error)
- func CreateLogFile(path string) (file *os.File, err error)
- func FileExists(path string) bool
- func GetAbsolutePath(path string) (string, error)
- func GetLocalIP() string
- func GetLocalIPs() []string
- func GetRequestId() (string, error)
- func Getenv(env string, def ...string) string
- func IsInt(s string) bool
- func IsSuccess(status int) bool
- func RandomString(n int32) string
- func TruncateUrl(value []byte) []byte
- func UnsafeBytes(s string) []byte
- func UnsafeString(b []byte) string
Constants ¶
View Source
const ( RequestIdLength = 32 MaxEncodedLength = (RequestIdLength*8 + 5) / 6 )
View Source
const (
UnknownIp = "UNKNOWN IP"
)
Variables ¶
Functions ¶
func AnonymizeIp ¶
AnonymizeIp slices ip address byte array and writes 0 to last octet example 192.172.90.70 -> 192.172.90.0
func CreateDirectoryFromFile ¶
func CreateFile ¶
func FileExists ¶
func GetAbsolutePath ¶
func GetLocalIP ¶
func GetLocalIP() string
func GetLocalIPs ¶
func GetLocalIPs() []string
func GetRequestId ¶
GetRequestId returns random byte slice of length 32
func RandomString ¶
func TruncateUrl ¶
func UnsafeBytes ¶
#nosec G103 UnsafeBytes returns a byte pointer without allocation
func UnsafeString ¶
#nosec G103 UnsafeString returns a string pointer without allocation
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.