go fmt'ed
This commit is contained in:
parent
b2974b7501
commit
85e0735fa3
2
db.go
2
db.go
@ -3,8 +3,8 @@ package main
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"log"
|
||||
"github.com/jackc/pgx/pgxpool"
|
||||
"log"
|
||||
)
|
||||
|
||||
func getDbPool() *pgxpool.Pool {
|
||||
|
@ -1,6 +1,7 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"github.com/jackc/pgx/pgxpool"
|
||||
"github.com/microcosm-cc/bluemonday"
|
||||
"log"
|
||||
"net/http"
|
||||
@ -8,7 +9,6 @@ import (
|
||||
"regexp"
|
||||
"runtime"
|
||||
"sync"
|
||||
"github.com/jackc/pgx/pgxpool"
|
||||
)
|
||||
|
||||
// Current instances
|
||||
|
@ -14,7 +14,7 @@ import (
|
||||
var p *bluemonday.Policy
|
||||
var spaceReg *regexp.Regexp
|
||||
|
||||
func GetRunner(endpoint string) (RunningInstance) {
|
||||
func GetRunner(endpoint string) RunningInstance {
|
||||
ri_mutex.Lock()
|
||||
o, exists := runninginstances[endpoint]
|
||||
if exists == false {
|
||||
@ -31,15 +31,13 @@ func GetRunner(endpoint string) (RunningInstance) {
|
||||
return o
|
||||
}
|
||||
|
||||
|
||||
func UpdateRunner(endpoint string, o RunningInstance) {
|
||||
ri_mutex.Lock()
|
||||
runninginstances[endpoint] = o
|
||||
ri_mutex.Unlock()
|
||||
}
|
||||
|
||||
|
||||
func GetNodeInfo(endpoint string, o RunningInstance) (RunningInstance) {
|
||||
func GetNodeInfo(endpoint string, o RunningInstance) RunningInstance {
|
||||
/* Checking order
|
||||
* Mastodon/Pleroma
|
||||
* Um..nothing else yet
|
||||
|
4
oauth.go
4
oauth.go
@ -26,7 +26,7 @@ func (e *authError) Error() string {
|
||||
return e.msg
|
||||
}
|
||||
|
||||
func register_client(endpoint string, o *RunningInstance) (error) {
|
||||
func register_client(endpoint string, o *RunningInstance) error {
|
||||
requestBodymap, _ := json.Marshal(map[string]string{
|
||||
"client_name": "Tusky", // Hard-coded in for now...
|
||||
"scopes": "read write follow push",
|
||||
@ -91,7 +91,7 @@ func register_client(endpoint string, o *RunningInstance) (error) {
|
||||
return nil
|
||||
}
|
||||
|
||||
func get_client(endpoint string, o *RunningInstance) (error) {
|
||||
func get_client(endpoint string, o *RunningInstance) error {
|
||||
var err error
|
||||
client_file := "clients/" + endpoint
|
||||
_, err = os.Stat(client_file)
|
||||
|
15
retrieve.go
15
retrieve.go
@ -2,14 +2,14 @@ package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"strings"
|
||||
"log"
|
||||
"encoding/json"
|
||||
"time"
|
||||
"io/ioutil"
|
||||
"net/http"
|
||||
"html"
|
||||
"errors"
|
||||
"html"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
"net/http"
|
||||
"strings"
|
||||
"time"
|
||||
)
|
||||
|
||||
type ImageType struct {
|
||||
@ -47,7 +47,6 @@ type PostJson struct {
|
||||
posthash []byte
|
||||
receivedAt time.Time `json:"created_at"`
|
||||
|
||||
|
||||
Content string `json:"content"`
|
||||
Conversation string `json:"conversation"`
|
||||
Published time.Time `json:"published"`
|
||||
@ -63,7 +62,7 @@ type PostJson struct {
|
||||
instance string
|
||||
}
|
||||
|
||||
func GetHTTPSession(endpoint string) (RunningInstance) {
|
||||
func GetHTTPSession(endpoint string) RunningInstance {
|
||||
ri_mutex.Lock()
|
||||
o, exist := runninginstances[endpoint]
|
||||
ri_mutex.Unlock()
|
||||
|
Loading…
x
Reference in New Issue
Block a user