working toward storing state in db
This commit is contained in:
@@ -1,20 +1,24 @@
|
||||
package instance
|
||||
|
||||
import "encoding/json"
|
||||
import "fmt"
|
||||
import "io/ioutil"
|
||||
import "net/http"
|
||||
import "strings"
|
||||
import "sync"
|
||||
import "time"
|
||||
import "errors"
|
||||
import (
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"net/http"
|
||||
"strings"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"git.eeqj.de/sneak/feta/jsonapis"
|
||||
"git.eeqj.de/sneak/feta/storage"
|
||||
"git.eeqj.de/sneak/feta/toot"
|
||||
"github.com/google/uuid"
|
||||
"github.com/looplab/fsm"
|
||||
"github.com/rs/zerolog/log"
|
||||
)
|
||||
|
||||
//import "github.com/gin-gonic/gin"
|
||||
import "github.com/looplab/fsm"
|
||||
import "github.com/rs/zerolog/log"
|
||||
import "git.eeqj.de/sneak/feta/storage"
|
||||
import "git.eeqj.de/sneak/feta/toot"
|
||||
import "git.eeqj.de/sneak/feta/jsonapis"
|
||||
|
||||
const nodeInfoSchemaVersionTwoName = "http://nodeinfo.diaspora.software/ns/schema/2.0"
|
||||
const instanceNodeinfoTimeout = time.Second * 50
|
||||
@@ -36,6 +40,7 @@ const (
|
||||
|
||||
// Instance stores all the information we know about an instance
|
||||
type Instance struct {
|
||||
Identifier uuid.UUID
|
||||
structLock sync.Mutex
|
||||
tootDestination chan *toot.Toot
|
||||
ErrorCount uint
|
||||
@@ -44,6 +49,7 @@ type Instance struct {
|
||||
Hostname string
|
||||
Identified bool
|
||||
fetching bool
|
||||
disabled bool
|
||||
implementation instanceImplementation
|
||||
storageBackend *storage.TootStorageBackend
|
||||
NextFetch time.Time
|
||||
|
||||
Reference in New Issue
Block a user