http connector first impl
This commit is contained in:
@@ -2,7 +2,7 @@ package connector
|
||||
|
||||
import (
|
||||
"context"
|
||||
model "galaxy/model/client"
|
||||
"galaxy/model/client"
|
||||
"galaxy/model/report"
|
||||
)
|
||||
|
||||
@@ -11,7 +11,7 @@ type Connector interface {
|
||||
UIConnector
|
||||
|
||||
// CheckConnection is called asynchronously every 5 seconds and tests is connection available with a specific backend server endpoint.
|
||||
// There is guaranteed backoff 5s -> 15s -> 30s -> 60s when no connection is available.
|
||||
// There is guaranteed jittered backoff with caps 5s -> 15s -> 30s -> 60s when no connection is available.
|
||||
CheckConnection() bool
|
||||
|
||||
// CheckVersion is called asynchronously every 30 minutes and receives from backend server information about currently available app versions.
|
||||
@@ -26,11 +26,11 @@ type UIConnector interface {
|
||||
// FetchReport asynchronously requests from backend server a [report.Report] for a given [model.GameID] and turn number.
|
||||
// Passed callback func will will accept non-nil error in case of I/O or decoding errors occuried,
|
||||
// otherwise callback func accepts loaded [report.Report].
|
||||
FetchReport(context.Context, model.GameID, uint, func(report.Report, error))
|
||||
FetchReport(context.Context, client.GameID, uint, func(report.Report, error))
|
||||
}
|
||||
|
||||
type VersionInfo struct {
|
||||
OS string `json:"os"` // Operating System name (unix, darwin, windows, etc.)
|
||||
Version string `json:"version"` // Semver format: X.Y.Z
|
||||
URL string `json:"url"` // URL for download artifacto for this version
|
||||
URL string `json:"url"` // Artifact download URL for this version
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user