Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( Copyright = fmt.Sprintf("Copyright (c) 2021-%d QuantStop.com", time.Now().Year()) PrereleaseBlurb = "This version is pre-release and is not intended to be used as a production ready system - use at your own risk." GitHub = "GitHub: https://github.com/QuantStop/QuantStopTerminal" Issues = "Issues: https://github.com/QuantStop/QuantStopTerminal/issues" )
Functions ¶
This section is empty.
Types ¶
type Engine ¶
type Engine struct { *config.Config // Config for engine, and all services *ServiceManager // Registry of all services sync.WaitGroup // Service WaitGroup }
func (*Engine) WaitForInterrupt ¶
func (bot *Engine) WaitForInterrupt()
type ServiceManager ¶
type ServiceManager struct {
// contains filtered or unexported fields
}
ServiceManager provides a useful pattern for managing services. It allows for ease of dependency management and ensures services dependent on others use the same references in memory.
func NewServiceManager ¶
func NewServiceManager() *ServiceManager
NewServiceManager creates a new instance of the ServiceManager struct
func (*ServiceManager) FetchService ¶
func (s *ServiceManager) FetchService(service interface{}) error
FetchService takes in a struct pointer and sets the value of that pointer to a service currently stored in the service registry. This ensures the input argument is set to the right pointer that refers to the originally registered service.
func (*ServiceManager) RegisterService ¶
func (s *ServiceManager) RegisterService(service service.IService) error
RegisterService appends a service to the service registry.
func (*ServiceManager) StartAll ¶
func (s *ServiceManager) StartAll(group *sync.WaitGroup)
StartAll initialized each service in order of registration.
func (*ServiceManager) StopAll ¶
func (s *ServiceManager) StopAll()
StopAll ends every service in reverse order of registration, logging a panic if any of them fail to stop.
type Version ¶
type Version struct { Version string BuildTime string Copyright string PrereleaseBlurb string GitHub string Issues string IsDaemon bool IsPreRelease bool IsDevMode bool }
func CreateDefaultVersion ¶
func CreateDefaultVersion() *Version
func (*Version) GetVersionString ¶
GetVersionString returns the version string