feat: add files/upload/limit endpoint
This commit is contained in:
parent
86380c7b3a
commit
b77bebe3b1
|
@ -156,6 +156,10 @@ func (f *FilesController) PostPinBy(cidString string) {
|
||||||
f.Ctx.StatusCode(iris.StatusCreated)
|
f.Ctx.StatusCode(iris.StatusCreated)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (f *FilesController) GetUploadLimit() {
|
||||||
|
f.respondJSON(&response.UploadLimit{Limit: f.Ctx.Application().ConfigurationReadOnly().GetPostMaxMemory()})
|
||||||
|
}
|
||||||
|
|
||||||
func validateCid(cidString string, validateStatus bool, ctx iris.Context) (string, bool) {
|
func validateCid(cidString string, validateStatus bool, ctx iris.Context) (string, bool) {
|
||||||
_, err := cid.Valid(cidString)
|
_, err := cid.Valid(cidString)
|
||||||
if sendError(ctx, err, iris.StatusBadRequest) {
|
if sendError(ctx, err, iris.StatusBadRequest) {
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
package response
|
||||||
|
|
||||||
|
type UploadLimit struct {
|
||||||
|
Limit int64 `json:"limit"`
|
||||||
|
}
|
Loading…
Reference in New Issue