|
|
@@ -0,0 +1,25 @@
|
|
|
+package user
|
|
|
+
|
|
|
+import (
|
|
|
+ "encoding/xml"
|
|
|
+ "net/http"
|
|
|
+)
|
|
|
+
|
|
|
+type Urlset struct {
|
|
|
+ Loc string `xml:"url>loc"`
|
|
|
+ Changefreq string `xml:"url>changefreq"`
|
|
|
+ Priority string `xml:"url>priority"`
|
|
|
+}
|
|
|
+
|
|
|
+func Sitemap(w http.ResponseWriter, r *http.Request) {
|
|
|
+ profile := Urlset{"dfsdf", "dgg", "fsdjfn"}
|
|
|
+
|
|
|
+ x, err := xml.MarshalIndent(profile, "", " ")
|
|
|
+ if err != nil {
|
|
|
+ http.Error(w, err.Error(), http.StatusInternalServerError)
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ w.Header().Set("Content-Type", "application/xml")
|
|
|
+ w.Write(x)
|
|
|
+}
|