Server_Protection_System

package
v0.0.0-...-ebb00e9 Latest Latest
Warning

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

Go to latest
Published: May 17, 2025 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Amount int
View Source
var Amount_i int
View Source
var ContentType string
View Source
var ContentType_i string
View Source
var Directory_name string
View Source
var Directory_name_i string
View Source
var Drive string
View Source
var Drive_i string
View Source
var FileName string
View Source
var FileName_i string

===============================================

View Source
var Folder_name string
View Source
var Folder_name_i string
View Source
var NameFile string
View Source
var NameFile_i string
View Source
var Path string
View Source
var Path_i string
View Source
var RedisClient *redis.Client
View Source
var Unit int
View Source
var Unit_i int

Functions

func Env_password_Loaded_string

func Env_password_Loaded_string(Type string) string

Env_password_Loaded_string

Parameters:

- This function receives the password from env, so its inputs are based on the parameters specified beforehand.

Example:

High speed in receiving passwords and receiving passwords with high security

func GenerateOTP

func GenerateOTP(length int, Number_length int) string

GenerateOTP

This package is responsible for generating random numbers.

Parameters:

length int = Number value For example : 10

Number_length = What number should the numbers be from? For example, the numbers used should be from 1 to 5.

Returns:

string = This is the output value that is returned, for example 123456.

func GetOtpFromRedis

func GetOtpFromRedis(email string, ch chan string)

GetOtpFromRedis

Redis code recipient based on email

Parameters:

email string , ch chan string

Returns:

OTP not found And Error retrieving OTP And otpcod

func Image_Get_Api

func Image_Get_Api(c *gin.Context)

This function is for capturing Image from the user.

Parameters:

- Amount_i int = File size value, for example 1 MB

- Unit_i int = The unit of value, for example 20, has three states:

1- 10 KB

2- 20 MB

3- 30 GB

- NameFile_i string = The name under which the user uploads their file.

- Folder_name_i string = The name of the folder where the Image is saved, for example, Uploads.

- Directory_name_i string = Directory path inside that folder, for example Image

- Drive_i string = The drive where the file is saved or the path itself, for example: D:/MyApp

var FileName_i string

var ContentType_i string

var Path_i string

These are the return parameters of this function.

func Movie_get_Api

func Movie_get_Api(c *gin.Context)

This function is for capturing video from the user.

Parameters:

- Amount int = File size value, for example 1 MB

- Unit int = The unit of value, for example 20, has three states:

1- 10 KB

2- 20 MB

3- 30 GB

- NameFile string = The name under which the user uploads their file.

- Folder_name string = The name of the folder where the video is saved, for example, Uploads.

- Directory_name string = Directory path inside that folder, for example video

- Drive string = The drive where the file is saved or the path itself, for example: D:/MyApp

var FileName string

var ContentType string

var Path string

var Emali string

var User string

var User_n string

These are the return parameters of this function.

func Run_Redis_Server

func Run_Redis_Server(ch chan string)

Run_Redis_Server

This is for starting redis

To start:

Run_Redis_Server(ch chan string)

func Run_Server_Sql

func Run_Server_Sql(ch chan string) (*sql.DB, error)

Run_Server_Sql

It is for starting the mysql server.

Returns:

- ch chan string

- database, err := Run_Server_Sql(ch)

func SaveOtpToRedis

func SaveOtpToRedis(email string, otp string, Storage int)

SaveOtpToRedis

It is for storing temporary code in the Redis system.

Parameters:

email string , otp string , Storage int

NOTE:

- Enter the storage duration based on your needs.

- Duration is based on minutes.

func Send_Email_otp

func Send_Email_otp(ch chan string, name_file_Email string, otp_cod string, SetHeader_server string, SetHeader_Client string)

Send_Email

This function is for sending emails [otp].

Parameters:

- ch chan string

- name_file_Email string for Example Email_sign_in.html

- otp_cod string for Example 123456

- SetHeader_server for Example Company name

- SetHeader_Client for Example Recipient's email

NOTE:

This code is only for the OTP system.

It gives an output to your html code which is for displaying the code.

Returns:

It returns three states:

1- err in template execution

2- Failed to send email

3- Email sent successfully

Types

This section is empty.

Jump to

Keyboard shortcuts

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