2020-11-10 21:53:46 -05:00
|
|
|
package main
|
|
|
|
|
|
|
|
const (
|
|
|
|
NEW_INSTANCE = 0
|
|
|
|
RUNNING = 200
|
|
|
|
TOOMANYREQUESTS = 429
|
|
|
|
CLIENT_ISSUE = 600
|
|
|
|
ONION_PROTOCOL = 601
|
|
|
|
BAD_RESPONSE = 602
|
|
|
|
BAD_NODEINFO = 604
|
2020-11-17 19:57:39 -05:00
|
|
|
UNSUPPORTED_INSTANCE = 605
|
2020-11-10 21:53:46 -05:00
|
|
|
)
|
|
|
|
|
|
|
|
// Parsing Unmarshal JSON type
|
|
|
|
type ReportPost struct {
|
|
|
|
|
|
|
|
// Retrieved values
|
|
|
|
Id string `json:"id"`
|
|
|
|
Url string `json:"url"`
|
|
|
|
Account AccountType
|
|
|
|
Content string `json:"content"`
|
|
|
|
Created_at string `json:"created_at"`
|
|
|
|
|
|
|
|
// Derived values
|
|
|
|
normalized string
|
|
|
|
posthash []byte
|
|
|
|
}
|
|
|
|
|
|
|
|
type AccountType struct {
|
|
|
|
Acct string `json:"acct"`
|
|
|
|
Avatar string `json:"avatar"`
|
|
|
|
Bot bool `json:"bot"`
|
|
|
|
Created_at string `json:"created_at"`
|
|
|
|
Display_name string `json:"display_name"`
|
|
|
|
Url string `json:"url"`
|
|
|
|
}
|
|
|
|
|
|
|
|
// Instance's new min_id value
|
|
|
|
type RunningInstance struct {
|
|
|
|
Software string `json:"software"`
|
|
|
|
Min_id string
|
|
|
|
Status int `json:"status"`
|
|
|
|
LastRun string `json:"lastrun"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type NodeInfoSoftware struct {
|
|
|
|
Name string `json:"name"`
|
|
|
|
Version string `json:"version"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type NodeInfo struct {
|
|
|
|
Software NodeInfoSoftware `json:"software"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type CommandMap struct {
|
|
|
|
Type string `json:"Type"`
|
|
|
|
Endpoint string `json:"Endpoint"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type ResponseBack struct {
|
|
|
|
Type string `json:"Type"`
|
|
|
|
Message string `json:"Message"`
|
2020-11-17 18:28:59 -05:00
|
|
|
RunningInstances map[string]RunningInstance `json:"RunningInstances"`
|
2020-11-10 21:53:46 -05:00
|
|
|
}
|