Documentation
¶
Index ¶
- type Service
- func (s *Service) CreateTrigger(userID int, functionID int, name, description string, ...) (*models.Trigger, error)
- func (s *Service) DeleteTrigger(id, userID int) error
- func (s *Service) ExecuteTrigger(ctx context.Context, id, userID int) (*models.TriggerEvent, error)
- func (s *Service) GetTrigger(id, userID int) (*models.Trigger, error)
- func (s *Service) GetTriggerHistory(triggerID, userID int, page, limit int) ([]*models.TriggerEvent, error)
- func (s *Service) ListTriggers(userID int, page, limit int) ([]*models.Trigger, error)
- func (s *Service) Start() error
- func (s *Service) Stop()
- func (s *Service) UpdateTrigger(id, userID int, functionID int, name, description string, ...) (*models.Trigger, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service handles contract automation
func NewService ¶
func NewService( cfg *config.Config, log *logger.Logger, triggerRepository models.TriggerRepository, functionService *functions.Service, blockchainClient *blockchain.Client, ) *Service
NewService creates a new automation service
func (*Service) CreateTrigger ¶
func (s *Service) CreateTrigger( userID int, functionID int, name, description string, triggerType models.TriggerType, triggerConfig json.RawMessage, ) (*models.Trigger, error)
CreateTrigger creates a new trigger
func (*Service) DeleteTrigger ¶
DeleteTrigger deletes a trigger
func (*Service) ExecuteTrigger ¶
ExecuteTrigger manually executes a trigger
func (*Service) GetTrigger ¶
GetTrigger gets a trigger by ID
func (*Service) GetTriggerHistory ¶
func (s *Service) GetTriggerHistory(triggerID, userID int, page, limit int) ([]*models.TriggerEvent, error)
GetTriggerHistory gets the execution history for a trigger
func (*Service) ListTriggers ¶
ListTriggers lists triggers for a user
func (*Service) UpdateTrigger ¶
func (s *Service) UpdateTrigger( id, userID int, functionID int, name, description string, triggerType models.TriggerType, triggerConfig json.RawMessage, ) (*models.Trigger, error)
UpdateTrigger updates an existing trigger
Click to show internal directories.
Click to hide internal directories.