hendler

package
v0.0.0-...-0fb43f7 Latest Latest
Warning

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

Go to latest
Published: May 3, 2022 License: AGPL-3.0 Imports: 10 Imported by: 0

README

hendler - processing and executing POST requests ✨

Package for processing POST requests and executing them using api packages

import to progect:
import "github.com/nik19ta/go_server/api/hendler"
Funcs:
  • GetFiles(w http.ResponseWriter, r *http.Request) - Sends the full list of files in the folder to Front
Post request:

Link: /api/local_files Body:

values: {
    filepath: ""
}
  • ReadFile(w http.ResponseWriter, r *http.Request) - Sends the file contents, last modified date, weight, and type to Front
Post request:

Link: /api/read_file Body:

values: {
  filepath: ""
}
  • RenameFile(w http.ResponseWriter, r *http.Request) - Renames the file / folder and sends the result of the operation to the Front
Post request:

Link: /api/rename_file Body:

values: {
  filepath: "",
  oldfilname: "",
  newfilname: ""
}
  • DeleteFile(w http.ResponseWriter, r *http.Request) - Delete the file / folder and sends the result of the operation to the Front
Post request:

Link: /api/delete_file Body:

value: {
  filepath: ""
}
  • CreateFile(w http.ResponseWriter, r *http.Request) - Create the file / folder and sends the result of the operation to the Front
Post request:

Link: /api/create_file Body:

value: {
  isdir: "",
  filepath: ""
}
  • LogIn(w http.ResponseWriter, r *http.Request) - Checks the user's password and returns true if the password matches and false if not and sends the result of the operation to the Front
Post request:

Link: /api/login Body:

value: {
  username: "",
  password: ""
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateFile

func CreateFile(w http.ResponseWriter, r *http.Request)

func DeleteFile

func DeleteFile(w http.ResponseWriter, r *http.Request)

DeleteFile - Delete the file / folder and sends the result of the operation to the Front

func GetFiles

func GetFiles(w http.ResponseWriter, r *http.Request)

GetFiles - Sends the full list of files in the folder to Front

func LogIn

func LogIn(w http.ResponseWriter, r *http.Request)

func ReadFile

func ReadFile(w http.ResponseWriter, r *http.Request)

ReadFile - Sends the file contents, last modified date, weight, and type to Front

func RenameFile

func RenameFile(w http.ResponseWriter, r *http.Request)

RenameFile - Renames the file / folder and sends the result of the operation to the Front

Types

type Request

type Request struct {
	Values map[string]string `json:"values"`
}

Jump to

Keyboard shortcuts

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