Refractor the project.
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Captain ALM 2022-07-16 11:47:52 +01:00
parent 884c88525e
commit da41214617
Signed by: alfred
GPG Key ID: 4E4ADD02609997B1
4 changed files with 6 additions and 5 deletions

View File

@ -2,8 +2,8 @@ package pageHandler
import ( import (
"golang.captainalm.com/cityuni-webserver/conf" "golang.captainalm.com/cityuni-webserver/conf"
"golang.captainalm.com/cityuni-webserver/pageHandler/utils"
"golang.captainalm.com/cityuni-webserver/utils/info" "golang.captainalm.com/cityuni-webserver/utils/info"
"golang.captainalm.com/cityuni-webserver/utils/io"
"html/template" "html/template"
"net/url" "net/url"
"os" "os"
@ -85,7 +85,7 @@ func (gipg *goInfoPage) GetContents(urlParameters url.Values) (contentType strin
if err != nil { if err != nil {
return "text/plain", []byte("Cannot Get Info.\r\n" + err.Error()), false return "text/plain", []byte("Cannot Get Info.\r\n" + err.Error()), false
} }
theBuffer := &utils.BufferedWriter{} theBuffer := &io.BufferedWriter{}
var regPages []string var regPages []string
var cacPages []string var cacPages []string
env := make([]string, 0) env := make([]string, 0)

View File

@ -1,6 +1,7 @@
package utils package utils
import ( import (
"golang.captainalm.com/cityuni-webserver/utils/io"
"mime/multipart" "mime/multipart"
"net/http" "net/http"
"net/textproto" "net/textproto"
@ -117,7 +118,7 @@ func ProcessRangePreconditions(maxLength int64, rw http.ResponseWriter, req *htt
} }
func GetMultipartLength(parts []ContentRangeValue, contentType string, maxLength int64) int64 { func GetMultipartLength(parts []ContentRangeValue, contentType string, maxLength int64) int64 {
cWriter := &CountingWriter{Length: 0} cWriter := &io.CountingWriter{Length: 0}
var returnLength int64 = 0 var returnLength int64 = 0
multWriter := multipart.NewWriter(cWriter) multWriter := multipart.NewWriter(cWriter)
for _, currentPart := range parts { for _, currentPart := range parts {

View File

@ -1,4 +1,4 @@
package utils package io
type BufferedWriter struct { type BufferedWriter struct {
Data []byte Data []byte

View File

@ -1,4 +1,4 @@
package utils package io
type CountingWriter struct { type CountingWriter struct {
Length int64 Length int64