823901b8ab
Configurations are separated in files in the folder config Connection to database by a package to import when needed Models will be in a model package for better maintenance Services access to the models Utils are tools or functions that can be used anywhere main.go cleaned a bit and other files modifications are there for the above modifications
22 lignes
Pas d'EOL
360 o
Go
22 lignes
Pas d'EOL
360 o
Go
package util
|
|
|
|
import (
|
|
"github.com/ewhal/nyaa/util/log"
|
|
|
|
"bytes"
|
|
"compress/zlib"
|
|
"io/ioutil"
|
|
)
|
|
|
|
func UnZlib(description []byte) string {
|
|
if len(description) > 0 {
|
|
b := bytes.NewReader(description)
|
|
z, err := zlib.NewReader(b)
|
|
log.CheckError(err)
|
|
defer z.Close()
|
|
p, err := ioutil.ReadAll(z)
|
|
log.CheckError(err)
|
|
return string(p)
|
|
}
|
|
return ""
|
|
} |