Documentation ¶
Index ¶
- Constants
- Variables
- func CompareHashWithPassword(hashedPassword, password string) bool
- func Contains(s []string, e string) bool
- func GetFreePort() (int, error)
- func GetFreePorts(count int) ([]int, error)
- func GetMapKeys(data map[string]string) []string
- func GetOutboundIP() (string, error)
- func HashPassword(password string) (string, error)
- func IsGenDNSAlive(url string) bool
- func IsValidPort(port int) bool
- func Log(context, message string, TAG int)
- func LogDebug(context, template string, args ...interface{})
- func LogError(context string, err error)
- func LogInfo(context, template string, args ...interface{})
- func LogResErr(context string, e types.ResponseError)
- func NewTarArchiveFromContent(content []byte, filename string, mode int64) (io.Reader, error)
- func NewTarArchiveFromPath(path string) (io.Reader, error)
- func NotAlive(url string) bool
- func QueryToFilter(queries map[string][]string) types.M
- func SendServerErrorResponse(c *gin.Context, err error)
- func ToStringSlice(v interface{}) []string
- type Scheduler
Constants ¶
const ( ErrorTAG = 1 InfoTAG = 2 DebugTAG = 3 )
tag definitions
Variables ¶
var HostIP, _ = GetOutboundIP()
HostIP variable stores the IPv4 address of the host machine
Functions ¶
func CompareHashWithPassword ¶
CompareHashWithPassword returns true if given password matches with the hash and false otherwise
func GetFreePort ¶
GetFreePort asks the kernel for a free open port that is ready to use.
func GetFreePorts ¶
GetFreePorts asks the kernel for free open ports that are ready to use.
func GetMapKeys ¶
GetMapKeys returns the keys present in a map
func GetOutboundIP ¶
GetOutboundIP returns the preferred outbound IP of this machine
func HashPassword ¶
HashPassword creates the hash of the password to be stored in database
func IsGenDNSAlive ¶
IsGenDNSAlive checks if a GenDNS instance is alive or not
func IsValidPort ¶
IsValidPort checks if the port is valid and free to use
func LogDebug ¶
func LogDebug(context, template string, args ...interface{})
LogDebug logs debug messages to console
func LogInfo ¶
func LogInfo(context, template string, args ...interface{})
LogInfo logs information to the console
func LogResErr ¶
func LogResErr(context string, e types.ResponseError)
LogResErr logs type ResponseError to console
func NewTarArchiveFromContent ¶
NewTarArchiveFromContent returns an io.Reader type tar archive from content in []byte
func NewTarArchiveFromPath ¶
NewTarArchiveFromPath returns an io.Reader type tar archive from content in given path
func QueryToFilter ¶
QueryToFilter filters out queries from the URL parameters
func SendServerErrorResponse ¶
SendServerErrorResponse sends internal server error messages to the client depending on development mode or production mode
func ToStringSlice ¶
func ToStringSlice(v interface{}) []string
ToStringSlice converts interface{} to []string
Types ¶
type Scheduler ¶
type Scheduler struct {
// contains filtered or unexported fields
}
Scheduler deals with running and managing various tasks at defined intervals
func NewScheduler ¶
NewScheduler returns a pointer to a Scheduler object