common

package
v0.9.4 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2023 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"
	PackageLabel  = "Cells Sync Client"
)

Functions

func PrintVersion

func PrintVersion()

PrintVersion prints information about the current build

Types

type CmdContent

type CmdContent struct {
	UUID string
	Cmd  string
}

CmdContent is a generic container for a Cmd sent via RPC

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
}

ConcreteSyncState is used for unmarshaling

type ConfigContent

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

ConfigContent is a generic container for a Config sent via RPV

type EndpointInfo

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

EndpointInfo provides information about a connection to an endpoint

type Message

type Message struct {
	Type    string
	Content interface{}
}

Message is a generic container for RPC

func MessageFromData

func MessageFromData(d []byte) *Message

MessageFromData parses generic Message from JSON and tries to cast its content to the according type.

func (*Message) Bytes

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

Bytes returns json-marshaled content of the message

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
}

SyncState provides information about a sync task

type UpdateApplyRequest

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

UpdateApplyRequest triggers an actual update

func (*UpdateApplyRequest) UpdateMessage

func (u *UpdateApplyRequest) UpdateMessage()

type UpdateApplyStatus

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

UpdateApplyStatus is a response to an UpdateApplyRequest

func (*UpdateApplyStatus) UpdateMessage

func (u *UpdateApplyStatus) UpdateMessage()

type UpdateCheckRequest

type UpdateCheckRequest struct {
	Check   bool
	Version bool
}

UpdateCheckRequest triggers a check for updates

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"`
}

UpdateCheckStatus provides a list of available binaries

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
}

UpdateVersion is a binary available for update

Jump to

Keyboard shortcuts

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