Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConnectorCaller ¶
type ConnectorCaller interface {
// contains filtered or unexported methods
}
ConnectorCaller is an interface to call a connector (mockable)
type ConnectorService ¶
type ConnectorService struct { Definition ConnectorCaller }
func NewConnectorService ¶
func NewConnectorService(definition Definition) *ConnectorService
NewConnectorService creates a new connector service (with http connector caller)
func (*ConnectorService) GetDefinition ¶
func (c *ConnectorService) GetDefinition() *Definition
GetDefinition returns the definition of the connector
func (*ConnectorService) GetStatus ¶
func (c *ConnectorService) GetStatus() Status
GetStatus returns the status of the connector
func (*ConnectorService) Reload ¶
func (c *ConnectorService) Reload(component string) (int, error)
Reload reloads the connector
func (*ConnectorService) Restart ¶
func (c *ConnectorService) Restart() (int, error)
Restart restarts the connector
type Definition ¶
type Definition struct { Id uuid.UUID `json:"id"` Name string `json:"name"` Url string `json:"-"` Key string `json:"-"` Type string `json:"type"` Components []string `json:"components"` LastRestart time.Time `json:"lastRestart"` LastReload time.Time `json:"lastReload"` }
func (Definition) HasComponent ¶
func (d Definition) HasComponent(component string) bool
HasComponent checks whether definition contains given component
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
func NewManager ¶
func NewManager() *Manager
func (Manager) LoadConnectors ¶
LoadConnectors loads the connectors from the config and register them
func (Manager) LoadPlugins ¶
LoadPlugins loads the plugins from the config and register them
type PluginService ¶
type PluginService struct { Definition plugin.MyrteaPlugin }
func (*PluginService) GetDefinition ¶
func (p *PluginService) GetDefinition() *Definition
GetDefinition returns the definition of the service
func (*PluginService) GetStatus ¶
func (p *PluginService) GetStatus() Status
func (*PluginService) Reload ¶
func (p *PluginService) Reload(component string) (int, error)
Reload reloads the service
func (*PluginService) Restart ¶
func (p *PluginService) Restart() (int, error)
Restart restarts the service
Click to show internal directories.
Click to hide internal directories.