just format and clean little stuff
This commit is contained in:
parent
0209571d87
commit
95c2c22d89
10
main.go
10
main.go
@ -21,18 +21,16 @@ import (
|
|||||||
"bytes"
|
"bytes"
|
||||||
"encoding/xml"
|
"encoding/xml"
|
||||||
"flag"
|
"flag"
|
||||||
|
|
||||||
"golang.org/x/tools/blog/atom"
|
|
||||||
|
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"log"
|
"log"
|
||||||
"mime"
|
"mime"
|
||||||
"net/http"
|
"net/http"
|
||||||
"net/url"
|
"net/url"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"golang.org/x/tools/blog/atom"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
@ -67,7 +65,7 @@ func handler(w http.ResponseWriter, req *http.Request) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if fi.IsDir() {
|
if fi.IsDir() {
|
||||||
content, err := getContent(w, req, fpath)
|
content, err := getContent(req, fpath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
@ -92,7 +90,7 @@ func main() {
|
|||||||
log.Fatal(http.ListenAndServe(":"+port, nil))
|
log.Fatal(http.ListenAndServe(":"+port, nil))
|
||||||
}
|
}
|
||||||
|
|
||||||
func getContent(w http.ResponseWriter, req *http.Request, dirpath string) (result []byte, err error) {
|
func getContent(req *http.Request, dirpath string) (result []byte, err error) {
|
||||||
feed := makeFeed(dirpath, req)
|
feed := makeFeed(dirpath, req)
|
||||||
if isAcquisition(dirpath) {
|
if isAcquisition(dirpath) {
|
||||||
acFeed := &AcquisitionFeed{&feed, "http://purl.org/dc/terms/", "http://opds-spec.org/2010/catalog"}
|
acFeed := &AcquisitionFeed{&feed, "http://purl.org/dc/terms/", "http://opds-spec.org/2010/catalog"}
|
||||||
|
Loading…
Reference in New Issue
Block a user