cdn

module
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2024 License: Apache-2.0

README

CDN API with Go and MinIO

Create your own Cdn service on Minio and Aws with Golang.

Overview

This project allows you to create your own Content Delivery Network (CDN) service using MinIO and AWS S3 with the Go programming language. You can use this CDN service to upload, retrieve, and delete images.

Prerequisites

Before you get started, make sure you have the following prerequisites installed on your computer:

  • Docker: You will need Docker to run this project.

Installation

Follow these steps to set up and run the project:

1- Clone the repository:

git clone https://github.com/mstgnz/cdn.git

2- Rename the .env.example file to .env and enter the required information. 3- Start the project with Docker Compose:

docker-compose up -d

Now, you can access the following services:

Postman Collection

You can find a Postman Collection for this project in the go-minio-cdn.postman_collection.json file.

Image Upload

Upload to MinIO
KEY VALUE
bucket bucket name
path slider
file choose file
width number (optional)
height number (optional)

Note: You can submit width and height if you want it to be resized during installation. If you send only width, the height will be assigned proportionally. If you send only the height, the width will be assigned proportionally. The resizing process is optional.

Upload to MinIO and AWS S3

If you want s3 glacier to be installed in your account, you should use this url.

KEY VALUE
bucket bucket name
path slider
file choose file
width number (optional)
height number (optional)

Note: You can submit width and height if you want it to be resized during installation. If you send only width, the height will be assigned proportionally. If you send only the height, the width will be assigned proportionally. The resizing process is optional.

Image Resize
KEY VALUE
width 500
height 400
file choose file

Image Get

Get Image
Get Image with Custom Width and Height
Notes:
  • if you use only width, height = will be proportioned according to the original size.
  • if you use only height, width = will be proportioned according to the original size.

Image Delete

Delete from MinIO
Delete from MinIO and AWS S3

Contributing

This project is open-source, and contributions are welcome. Feel free to contribute or provide feedback of any kind.

License

This project is licensed under the Apache License. See the LICENSE file for more details.

Directories

Path Synopsis
Package handler /*
Package handler /*

Jump to

Keyboard shortcuts

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