utils

package
v0.0.0-...-70aaee8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 10, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClearTerminal

func ClearTerminal() error

func Exec

func Exec(c *fiber.Ctx, command string) (string, error)

Exec run a command in the linux operating system Parameters:

  • string (command): takes the command dictated by the request

Return:

  • string: the answer given by the system
  • error: if there is an error, it is returned so that when the function is used, it can be reported.

func GenerateToken

func GenerateToken() string

GenerateToken using mathematical functions generates a code that will be used as a token. Return:

  • string: The token generated in string format

func GetIP

func GetIP() string

func Indicate

func Indicate(format string, a ...interface{}) string

func Log

func Log(c *fiber.Ctx, logs ...string) error

Log records one or more given commands and saves them to a .txt file Parameters:

  • string array: takes the string or several strings and saves them

Return:

  • error: if there is an error, it is returned so that when the function is used, it can be reported.

func Problem

func Problem(format string, a ...interface{}) string

func VerifyToken

func VerifyToken(token string) bool

VerifyToken uses uuid to generate the token in hash format Return:

  • string: returns the token in string format
  • error: if there is an error, it is returned so that when the function is used, it can be reported.

Types

type Token

type Token struct {
	AccessToken string
}
var Tokens *Token

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL