Categorygithub.com/gflydev/modules/storage
modulepackage
1.0.4
Repository: https://github.com/gflydev/modules.git
Documentation: pkg.go.dev

# README

Module Storage

Storage APIs

GET /api/v1/storage/presigned-url
POST /api/v1/storage/uploads
PUT /api/v1/storage/uploads/{file_name}
PUT /api/v1/storage/legitimize-files

Usage

Install

go get -u github.com/gflydev/modules/[email protected]

File main.go

import (
    _ "github.com/gflydev/cache/redis"
    _ "github.com/gflydev/storage/local"
)

File api_routes.go

import "github.com/gflydev/modules/storage/api"

// `API` Router
g.Group(prefixAPI, func(apiRouter *core.Group) {
    /* ============================ Storage Group ==========================================*/
    apiRouter.Group("/storage", func(uploadGroup *core.Group) {
        uploadGroup.GET("/presigned-url", api.NewPresignedURLApi())      // Get presigned URL
        uploadGroup.POST("/uploads", api.NewUploadApi())                 // Upload files to server by Field Form
        uploadGroup.PUT("/uploads/{file_name}", api.NewUploadFileApi())  // Upload a file to server via Body (Binary)
        uploadGroup.PUT("/legitimize-files", api.NewLegitimizeFileApi()) // Legitimize uploaded file
    })
})

# Packages

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Functions

LegitimizeFiles make file list available.
PresignedURL generate pre-signed upload URL from Local storage.