Documentation ¶
Index ¶
- Variables
- func ResponseToBArray(response *http.Response) ([]byte, error)
- type ConnectionStats
- type ConnectionStatsResponse
- type EventType
- type FolderCompletion
- type Model
- type StatusEnum
- type SyncthingHttpClient
- func (p *SyncthingHttpClient) Completion() (FolderCompletion, error)
- func (p *SyncthingHttpClient) Events(since int64) ([]event, error)
- func (p *SyncthingHttpClient) FolderOverride() error
- func (p *SyncthingHttpClient) FolderStatus() (Model, error)
- func (p *SyncthingHttpClient) GetSyncthingStatus() *SyncthingStatus
- func (s *SyncthingHttpClient) Post(path, body string) ([]byte, error)
- func (p *SyncthingHttpClient) Scan() error
- func (p *SyncthingHttpClient) SystemConnections() (bool, error)
- type SyncthingStatus
Constants ¶
This section is empty.
Variables ¶
View Source
var AppNotInstalledTemplate = &SyncthingStatus{ Status: End, Msg: "Application not installed", Tips: Identifier + "Current Application is not installed, please check your application is installed correctly.", }
View Source
var DevModeStarting = &SyncthingStatus{ Status: End, Msg: "DevMode Starting...", Tips: Identifier + "File sync in preparation.", }
View Source
var NotInDevModeTemplate = &SyncthingStatus{ Status: End, Msg: "Not in DevMode", Tips: Identifier + "File sync does not working due to the devMode is not enabled.", }
View Source
var NotProcessor = &SyncthingStatus{ Status: End, Msg: "Other device is developing", Tips: Identifier + "File Sync is hold by other device, if you want to take over the file sync, " + "you should end the dev mode and re enter again.", }
View Source
var NotSyncthingProcessFound = &SyncthingStatus{ Status: Disconnected, Msg: "No syncthing process found", Tips: Identifier + "No syncthing process found, please restart it.", }
View Source
var WelcomeTemplate = &SyncthingStatus{ Status: End, Msg: "Welcome to Nocalhost", Tips: Identifier + "There is no service associated with the current directory", }
Functions ¶
Types ¶
type ConnectionStats ¶
type ConnectionStatsResponse ¶
type ConnectionStatsResponse struct {
Connections map[string]ConnectionStats `json:"connections"`
}
type EventType ¶
type EventType string
const (
EventFolderCompletion EventType = "FolderCompletion"
)
type FolderCompletion ¶
type FolderCompletion struct { Completion float64 `json:"completion"` GlobalBytes int64 `json:"globalBytes"` NeedBytes int64 `json:"needBytes"` GlobalItems int `json:"globalItems"` NeedItems int `json:"needItems"` NeedDeletes int `json:"needDeletes"` Sequence int64 `json:"sequence"` }
func (*FolderCompletion) NeedOverrideForce ¶
func (f *FolderCompletion) NeedOverrideForce() bool
func (*FolderCompletion) UploadPct ¶
func (f *FolderCompletion) UploadPct() string
type Model ¶
type Model struct { GlobalBytes int GlobalDeleted int GlobalFiles int InSyncBytes int InSyncFiles int Invalid string LocalBytes int LocalDeleted int LocalFiles int NeedBytes int NeedFiles int State string StateChanged time.Time Version int }
func (*Model) OutOfSyncLog ¶
func (*Model) OutOfSyncTips ¶
func (*Model) StateChangedLog ¶
type StatusEnum ¶
type StatusEnum string
const ( Disconnected StatusEnum = "disconnected" OutOfSync StatusEnum = "outOfSync" Scanning StatusEnum = "scanning" Syncing StatusEnum = "syncing" Error StatusEnum = "error" Idle StatusEnum = "idle" End StatusEnum = "end" Identifier = "(Nocalhost): " )
Use strings as keys to make printout and serialization of the locations map more meaningful.
type SyncthingHttpClient ¶
type SyncthingHttpClient struct {
// contains filtered or unexported fields
}
func NewSyncthingHttpClient ¶
func (*SyncthingHttpClient) Completion ¶
func (p *SyncthingHttpClient) Completion() (FolderCompletion, error)
func (*SyncthingHttpClient) Events ¶
func (p *SyncthingHttpClient) Events(since int64) ([]event, error)
func (*SyncthingHttpClient) FolderOverride ¶
func (p *SyncthingHttpClient) FolderOverride() error
func (*SyncthingHttpClient) FolderStatus ¶
func (p *SyncthingHttpClient) FolderStatus() (Model, error)
func (*SyncthingHttpClient) GetSyncthingStatus ¶
func (p *SyncthingHttpClient) GetSyncthingStatus() *SyncthingStatus
func (*SyncthingHttpClient) Post ¶
func (s *SyncthingHttpClient) Post(path, body string) ([]byte, error)
func (*SyncthingHttpClient) Scan ¶
func (p *SyncthingHttpClient) Scan() error
func (*SyncthingHttpClient) SystemConnections ¶
func (p *SyncthingHttpClient) SystemConnections() (bool, error)
type SyncthingStatus ¶
type SyncthingStatus struct { Status StatusEnum `yaml:"status" json:"status"` Msg string `json:"msg"` Tips string `json:"tips,omitempty"` OutOfSync string `json:"outOfSync,omitempty"` Gui string `json:"gui,omitempty"` }
the nhctl sync --status result
Click to show internal directories.
Click to hide internal directories.