file-info

command module
v0.0.0-...-a9aa9b7 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2021 License: MIT Imports: 12 Imported by: 0

README

File-info API

An API that takes in a file and gives back info about the file.

The data is stored in a mysql database but the file is discarded.

Requirements
  • Golang.
  • Mysql.
  • Postman or REST CLIENT from Vscode for testing.

To run it locally, edit the .env file, set up myql connection, create database called fileinfodb

To create table property, run the command:

$ mysql -u yourusername -p dbnamehere < database/fileinfodb.sql

e.g file - hello.py

request URI locally: http://localhost:8080/upload

Response:
{
    "id":7,
    "name":"hello",
    "extension":".py",
    "size":128,
    "type":"application/octet-stream"
}

Size is in bytes always.

Available paths:
function path method
welcome / GET
upload file /upload POST

Happy coding.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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