mirror of
https://github.com/Forceu/Gokapi.git
synced 2026-01-04 07:49:32 -06:00
Fixed lint issues, set Go version to 1.16.4
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
FROM golang:1.16 AS build_base
|
||||
FROM golang:1.16.4 AS build_base
|
||||
|
||||
## Usage:
|
||||
## docker build . -t gokapi
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
FROM golang:1.16
|
||||
FROM golang:1.16.4
|
||||
|
||||
## To compile:
|
||||
## cd Gokapi/build/
|
||||
|
||||
@@ -6,4 +6,4 @@ type ApiKey struct {
|
||||
FriendlyName string `json:"FriendlyName"`
|
||||
LastUsed int64 `json:"LastUsed"`
|
||||
LastUsedString string `json:"LastUsedString"`
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
package models
|
||||
|
||||
// UploadRequest is used to set an upload request
|
||||
type UploadRequest struct {
|
||||
AllowedDownloads int
|
||||
Expiry int
|
||||
ExpiryTimestamp int64
|
||||
ExpiryTimestamp int64
|
||||
Password string
|
||||
ExternalUrl string
|
||||
}
|
||||
|
||||
@@ -31,4 +31,4 @@ func TestSetUpgradeConfigFile(t *testing.T) {
|
||||
WriteUpgradeConfigFile()
|
||||
test.IsEqualBool(t, helper.FileExists(configFile), true)
|
||||
TestDelete(t)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,6 +38,7 @@ func Process(w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
}
|
||||
|
||||
// DeleteKey deletes the selected API key
|
||||
func DeleteKey(id string) bool {
|
||||
if !isValidKey(id, false) {
|
||||
return false
|
||||
@@ -48,6 +49,7 @@ func DeleteKey(id string) bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// NewKey generates a new API key
|
||||
func NewKey() string {
|
||||
settings := configuration.GetServerSettings()
|
||||
newKey := models.ApiKey{
|
||||
|
||||
@@ -11,6 +11,7 @@ import (
|
||||
"time"
|
||||
)
|
||||
|
||||
// Process processes a file upload request
|
||||
func Process(w http.ResponseWriter, r *http.Request, isWeb bool) error {
|
||||
err := r.ParseMultipartForm(20 * 1024 * 1024)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user