Documentation ¶
Index ¶
- Constants
- type Config
- type MonitorService
- type Storage
- func (storage *Storage) AddFileTransfer(transfer types.ReportFileTransfer) error
- func (storage *Storage) AddInstance(instance types.ReportInstance)
- func (storage *Storage) CleanUp()
- func (storage *Storage) Destroy()
- func (storage *Storage) GetInstance(instanceID string) (types.ReportInstance, bool)
- func (storage *Storage) Init() error
- func (storage *Storage) ListFileTransfers() []types.ReportFileTransfer
- func (storage *Storage) ListFileTransfersForInstance(instanceID string) []types.ReportFileTransfer
- func (storage *Storage) ListInstances() []types.ReportInstance
- func (storage *Storage) TerminateInstance(instanceID string) error
- func (storage *Storage) UpdateInstanceLastActivityTime(instanceID string) error
Constants ¶
View Source
const (
DataLifeSpanDays = 7
)
View Source
const (
ServicePortDefault int = 11010
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { ServicePort int `envconfig:"SERVICE_PORT" yaml:"service_port"` LogPath string `envconfig:"LOG_PATH" yaml:"log_path,omitempty"` Foreground bool `yaml:"foreground,omitempty"` ChildProcess bool `yaml:"childprocess,omitempty"` }
Config holds the parameters list which can be configured
func NewConfigFromENV ¶
NewConfigFromENV creates Config from Environmental Variables
func NewConfigFromYAML ¶
NewConfigFromYAML creates Config from YAML
type MonitorService ¶
type MonitorService struct { Config *Config WebServer *http.Server Router *mux.Router Storage *Storage }
MonitorService is a service object
func NewMonitorService ¶
func NewMonitorService(config *Config) *MonitorService
NewMonitorService creates a new monitor service
type Storage ¶
type Storage struct { Instances map[string]types.ReportInstance FileTransfers map[string][]types.ReportFileTransfer Mutex sync.Mutex }
Storage is a storage object
func (*Storage) AddFileTransfer ¶
func (storage *Storage) AddFileTransfer(transfer types.ReportFileTransfer) error
AddInstance adds an instance
func (*Storage) AddInstance ¶
func (storage *Storage) AddInstance(instance types.ReportInstance)
AddInstance adds an instance
func (*Storage) CleanUp ¶
func (storage *Storage) CleanUp()
CleanUp clears all instance and transfer data
func (*Storage) GetInstance ¶
func (storage *Storage) GetInstance(instanceID string) (types.ReportInstance, bool)
GetInstance returns instance
func (*Storage) ListFileTransfers ¶
func (storage *Storage) ListFileTransfers() []types.ReportFileTransfer
ListInstances lists instances
func (*Storage) ListFileTransfersForInstance ¶
func (storage *Storage) ListFileTransfersForInstance(instanceID string) []types.ReportFileTransfer
ListInstances lists instances
func (*Storage) ListInstances ¶
func (storage *Storage) ListInstances() []types.ReportInstance
ListInstances lists instances
func (*Storage) TerminateInstance ¶
TerminateInstance sets the instance terminated
func (*Storage) UpdateInstanceLastActivityTime ¶
UpdateInstanceLastActivityTime updates the instance's last activity time
Click to show internal directories.
Click to hide internal directories.