Documentation ¶
Overview ¶
Package utils - BitMonster utilities
Package utils - BitMonster utilities
Index ¶
- func MarshalValues(first, second string) string
- func RandomString(n int) string
- func RemoteAddress(r *http.Request) (string, bool)
- func RemoveDuplicateStrings(a []string) []string
- func RemovePortFromRemoteAddr(remoteAddr string) string
- func UUID() string
- func UnmarshalValues(data string) (first, second string, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MarshalValues ¶
MarshalValues joins two values into a single string. They can be decoded by the UnmarshalValues function.
func RemoteAddress ¶
RemoteAddress returns the IP address of the request. If the X-Forwarded-For or X-Real-Ip http headers are set, then they are used to obtain the remote address. The boolean is true, if the remote address is obtained using the request RemoteAddr() method.
func RemoveDuplicateStrings ¶
RemoveDuplicateStrings removes duplicate strings from a string slice.
func RemovePortFromRemoteAddr ¶
RemovePortFromRemoteAddr removes the port if present from the remote address.
func UnmarshalValues ¶
UnmarshalValues splits two values from a single string. This function is chainable to extract multiple values.
Types ¶
This section is empty.