api: run go fmt

This commit is contained in:
Adhityaa 2018-06-16 19:00:03 +05:30
parent 816b0ec6f3
commit 590e878679
2 changed files with 26 additions and 26 deletions

View File

@ -16,9 +16,9 @@ func parseConfig() error {
defaults := map[string]string{
"POSTGRES": "postgres://postgres:postgres@localhost/commento?sslmode=disable",
"BIND_ADDRESS": "127.0.0.1",
"PORT": "8080",
"ORIGIN": "",
"BIND_ADDRESS": "127.0.0.1",
"PORT": "8080",
"ORIGIN": "",
"CDN_PREFIX": "",

View File

@ -1,27 +1,27 @@
package main
import (
"time"
"io/ioutil"
"net/http"
"compress/gzip"
"encoding/xml"
"io/ioutil"
"net/http"
"time"
// "github.com/grokify/html-strip-tags-go"
"github.com/lunny/html2md"
)
type disqusThread struct {
XMLName xml.Name `xml:"thread"`
Id string `xml:"http://disqus.com/disqus-internals id,attr"`
URL string `xml:"link"`
Name string `xml:"name"`
Id string `xml:"http://disqus.com/disqus-internals id,attr"`
URL string `xml:"link"`
Name string `xml:"name"`
}
type disqusAuthor struct {
XMLName xml.Name `xml:"author"`
IsAnonymous bool `xml:"isAnonymous"`
Name string `xml:"name"`
Email string `xml:"email"`
XMLName xml.Name `xml:"author"`
IsAnonymous bool `xml:"isAnonymous"`
Name string `xml:"name"`
Email string `xml:"email"`
}
type disqusThreadId struct {
@ -40,22 +40,22 @@ type disqusPostId struct {
}
type disqusPost struct {
XMLName xml.Name `xml:"post"`
Id string `xml:"http://disqus.com/disqus-internals id,attr"`
XMLName xml.Name `xml:"post"`
Id string `xml:"http://disqus.com/disqus-internals id,attr"`
ThreadId disqusThreadId `xml:"thread"`
ParentId disqusParentId `xml:"parent"`
PostId disqusPostId `xml:"post"`
Message string `xml:"message"`
CreationDate time.Time `xml:"createdAt"`
IsDeleted bool `xml:"isDeleted"`
IsSpam bool `xml:"isSpam"`
Author disqusAuthor `xml:"author"`
ParentId disqusParentId `xml:"parent"`
PostId disqusPostId `xml:"post"`
Message string `xml:"message"`
CreationDate time.Time `xml:"createdAt"`
IsDeleted bool `xml:"isDeleted"`
IsSpam bool `xml:"isSpam"`
Author disqusAuthor `xml:"author"`
}
type disqusXML struct {
XMLName xml.Name `xml:"disqus"`
XMLName xml.Name `xml:"disqus"`
Threads []disqusThread `xml:"thread"`
Posts []disqusPost `xml:"post"`
Posts []disqusPost `xml:"post"`
}
func domainImportDisqus(domain string, url string) (int, error) {
@ -170,8 +170,8 @@ func domainImportDisqus(domain string, url string) (int, error) {
func domainImportDisqusHandler(w http.ResponseWriter, r *http.Request) {
type request struct {
Session *string `json:"session"`
Domain *string `json:"domain"`
URL *string `json:"url"`
Domain *string `json:"domain"`
URL *string `json:"url"`
}
var x request