image-api

command module
v0.0.0-...-41ccdf9 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2023 License: GPL-3.0 Imports: 21 Imported by: 0

README

Image-API

REST service for uploading and managing images and other media. Exposes a simple API for uploading media and accessing. Using Minio cloud storage and docker. https://godoc.org/github.com/minio/minio-go You can run image-api separately, but we recommend using docker and docker-compose.

Build

docker build -t image-api .
or
docker-compose build image-api

Usage

Minotaur needs some ENV vars set for Minio Bucket storage: create a .env file:

MINIO_ACCESS_KEY=<somerandomid>
MINIO_SECRET_KEY=<asecrethash>

To start:

docker-compose up -d
Usage of image-api:
  -l string
      server listening address (default ":1666")
  -mssl
      Use ssl with minio
  -mhost string
      Address of minio storage API (default "localhost:9000")

Documentation

Standard setup exposes two services:

Minio DB : localhost:9000 API : localhost:9001

API

POST    localhost:9001/api/images/{bucket}       Upload Image to specified bucket (form data upload, e.g. curl -F "file=@./somefile.png" )
   Response: JSON id, and length of uploaded image, and url to stored image in Minio
PUT     localhost:9001/api/images/{bucket}/{id}  Overwrite Image Object (form data upload, e.g. curl -XPUT -F "file=@./somefile.png" )
GET     localhost:9001/api/images/{bucket}/{id}  Get Image Object
DELETE  localhost:9001/api/images/{bucket}/{id}  Delete Image Object

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

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