https://github.com/dmdhrumilmistry/gofilecheck
API for detecting file type using magic bytes
https://github.com/dmdhrumilmistry/gofilecheck
file-validation go golang microservice
Last synced: about 2 months ago
JSON representation
API for detecting file type using magic bytes
- Host: GitHub
- URL: https://github.com/dmdhrumilmistry/gofilecheck
- Owner: dmdhrumilmistry
- Created: 2024-06-15T19:33:42.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2025-03-15T09:03:00.000Z (2 months ago)
- Last Synced: 2025-03-28T05:42:21.136Z (about 2 months ago)
- Topics: file-validation, go, golang, microservice
- Language: Go
- Homepage:
- Size: 15.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# GoFileCheck
Microservice written in GoLang for checking file types using magic bytes
## Installation
### Using GoBinaries
* Install using gobinaries
```bash
curl -sf https://gobinaries.com/dmdhrumilmistry/gofilecheck | sh
```* Start API
```bash
gofilecheck
```### Using Golang and Github
* Get and build project
```bash
go install github.com/dmdhrumilmistry/gofilecheck/cmd/gofilecheck@latest
```* Start API
```bash
gofilecheck
```### Using Docker
* Download docker file and start containers
```bash
docker compose up -d
```## Usage
* Send file to API
```bash
curl --location 'http://localhost:3000/api/check' \
--form 'file=@"/path/to/png/file.png"'
```Response
```json
{
"extension": ".png",
"filename": "gofilecheck.png",
"size": 315659,
"type": "image/png"
}
```