update: add pool query to package page
This commit is contained in:
17
lib/pool.go
17
lib/pool.go
@ -8,6 +8,8 @@ import (
|
||||
"io"
|
||||
"os"
|
||||
"path"
|
||||
"strings"
|
||||
"unicode"
|
||||
|
||||
"github.com/bigkevmcd/go-configparser"
|
||||
)
|
||||
@ -25,6 +27,21 @@ type Pool struct {
|
||||
Dir string `json:"dir"`
|
||||
}
|
||||
|
||||
func (p *Pool) ID() string {
|
||||
var res string = ""
|
||||
|
||||
for _, c := range p.Display {
|
||||
if unicode.IsDigit(c) || unicode.IsLetter(c) {
|
||||
res += string(c)
|
||||
continue
|
||||
}
|
||||
|
||||
res += "-"
|
||||
}
|
||||
|
||||
return strings.TrimSuffix(res, "-")
|
||||
}
|
||||
|
||||
func (p *Pool) Load(list *[]Package) error {
|
||||
var err error
|
||||
|
||||
|
Reference in New Issue
Block a user