common

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 21, 2019 License: GPL-3.0 Imports: 8 Imported by: 4

Documentation

Overview

Package common exposes package variables that are updated via ldflags compilation

Index

Constants

This section is empty.

Variables

View Source
var (
	Version       = "0.1.0"
	BuildStamp    = ""
	BuildRevision = ""
	PackageType   = "CellsSync"
)

Functions

func PrintVersion

func PrintVersion(appName string)

Types

type CmdContent

type CmdContent struct {
	UUID string
	Cmd  string
}

type ConcreteSyncState

type ConcreteSyncState struct {
	// Sync Process
	UUID   string
	Config *config.Task

	Status             model.TaskStatus
	LastSyncTime       time.Time               `json:"LastSyncTime,omitempty"`
	LastOpsTime        time.Time               `json:"LastOpsTime,omitempty"`
	LastProcessStatus  *model.ProcessingStatus `json:"LastProcessStatus,omitempty"`
	LeftProcessStatus  *model.ProcessingStatus `json:"LeftProcessStatus,omitempty"`
	RightProcessStatus *model.ProcessingStatus `json:"RightProcessStatus,omitempty"`

	// Endpoints Current Info
	LeftInfo  *EndpointInfo
	RightInfo *EndpointInfo
}

Used for unmarshaling

type ConfigContent

type ConfigContent struct {
	Cmd    string
	Config *config.Task
}

type EndpointInfo

type EndpointInfo struct {
	Stats          *model.EndpointRootStat
	Connected      bool
	WatcherActive  bool
	LastConnection time.Time
}

type Message

type Message struct {
	Type    string
	Content interface{}
}

func MessageFromData

func MessageFromData(d []byte) *Message

func (*Message) Bytes

func (m *Message) Bytes() []byte

type SyncState

type SyncState struct {
	// Sync Process
	UUID   string
	Config *config.Task

	Status             model.TaskStatus
	LastSyncTime       time.Time    `json:"LastSyncTime,omitempty"`
	LastOpsTime        time.Time    `json:"LastOpsTime,omitempty"`
	LastProcessStatus  model.Status `json:"LastProcessStatus,omitempty"`
	LeftProcessStatus  model.Status `json:"LeftProcessStatus,omitempty"`
	RightProcessStatus model.Status `json:"RightProcessStatus,omitempty"`

	// Endpoints Current Info
	LeftInfo  *EndpointInfo
	RightInfo *EndpointInfo
}

type UpdateApplyRequest

type UpdateApplyRequest struct {
	Package *update.Package
	DryRun  bool
}

func (*UpdateApplyRequest) UpdateMessage

func (u *UpdateApplyRequest) UpdateMessage()

type UpdateApplyStatus

type UpdateApplyStatus struct {
	ApplyStatus string
	Package     *update.Package
	Progress    float32
	Error       string
}

func (*UpdateApplyStatus) UpdateMessage

func (u *UpdateApplyStatus) UpdateMessage()

type UpdateCheckRequest

type UpdateCheckRequest struct {
	Check   bool
	Version bool
}

func (*UpdateCheckRequest) UpdateMessage

func (u *UpdateCheckRequest) UpdateMessage()

Detect message type

type UpdateCheckStatus

type UpdateCheckStatus struct {
	CheckStatus string
	Binaries    []*update.Package
	Error       string `json:"error,omitempty"`
}

func (*UpdateCheckStatus) UpdateMessage

func (u *UpdateCheckStatus) UpdateMessage()

type UpdateMessage

type UpdateMessage interface {
	UpdateMessage()
}

Various messages for communicating with service

type UpdateVersion

type UpdateVersion struct {
	PackageName string
	Version     string
	Revision    string
	BuildStamp  string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL