Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ExecuteRequest ¶
type ExecuteRequest struct {
// Params are the invocation parameters specific to the module
Params interface{}
// Providers is the list of providers to process
Providers []*cqproto.GetProviderSchemaResponse
// Conn is the db connection to use
Conn *pgxpool.Conn
}
type ExecutionResult ¶
type Manager ¶
type Manager interface {
// RegisterModule is used to register a module into the manager.
RegisterModule(mod Module)
// ExecuteModule executes the given module, validating the given module name and config first.
ExecuteModule(ctx context.Context, modName, modConfigPath string, execReq *ExecuteRequest) (*ExecutionResult, error)
// ReadConfig reads the given module's default/builtin config
ReadConfig(modName string) ([]byte, error)
}
Manager is the interface that describes the interaction with the module manager. Implemented by ManagerImpl.
type ManagerImpl ¶
type ManagerImpl struct {
// contains filtered or unexported fields
}
ManagerImpl is the manager implementation struct.
func NewManager ¶
func NewManager(pool *pgxpool.Pool, logger hclog.Logger) *ManagerImpl
NewManager returns a new manager instance.
func (*ManagerImpl) ExecuteModule ¶
func (m *ManagerImpl) ExecuteModule(ctx context.Context, modName, modConfigPath string, execReq *ExecuteRequest) (*ExecutionResult, error)
ExecuteModule executes the given module, validating the given module name and config first.
func (*ManagerImpl) ReadConfig ¶
func (m *ManagerImpl) ReadConfig(modName string) ([]byte, error)
ReadConfig reads the given module's default/builtin config
func (*ManagerImpl) RegisterModule ¶
func (m *ManagerImpl) RegisterModule(mod Module)
RegisterModule is used to register a module into the manager.
type Module ¶
type Module interface {
// ID returns the name of the module
ID() string
// Configure configures the module to run
Configure(context.Context, hcl.Body) error
// Execute executes the module, using given args in ExecuteRequest
Execute(context.Context, *ExecuteRequest) *ExecutionResult
}
Click to show internal directories.
Click to hide internal directories.