mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-05-14 07:26:47 +00:00
* Update URLs for transfer into org repo * Update codecov, travis and othe remaining links * Update appveyor paths
55 lines
1.1 KiB
Go
55 lines
1.1 KiB
Go
package base
|
|
|
|
import (
|
|
"time"
|
|
)
|
|
|
|
// global vars contain staged update data that will be sent to the communication
|
|
// mediums
|
|
var (
|
|
ServiceStarted time.Time
|
|
)
|
|
|
|
// Base enforces standard variables across communication packages
|
|
type Base struct {
|
|
Name string
|
|
Enabled bool
|
|
Verbose bool
|
|
Connected bool
|
|
}
|
|
|
|
// Event is a generalise event type
|
|
type Event struct {
|
|
Type string
|
|
Message string
|
|
}
|
|
|
|
// CommsStatus stores the status of a comms relayer
|
|
type CommsStatus struct {
|
|
Enabled bool `json:"enabled"`
|
|
Connected bool `json:"connected"`
|
|
}
|
|
|
|
// IsEnabled returns if the comms package has been enabled in the configuration
|
|
func (b *Base) IsEnabled() bool {
|
|
return b.Enabled
|
|
}
|
|
|
|
// IsConnected returns if the package is connected to a server and/or ready to
|
|
// send
|
|
func (b *Base) IsConnected() bool {
|
|
return b.Connected
|
|
}
|
|
|
|
// GetName returns a package name
|
|
func (b *Base) GetName() string {
|
|
return b.Name
|
|
}
|
|
|
|
// GetStatus returns status data
|
|
func (b *Base) GetStatus() string {
|
|
return `
|
|
GoCryptoTrader Service: Online
|
|
Service Started: ` + ServiceStarted.String()
|
|
}
|