trigger

package
v1.13.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 24, 2025 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Overview

Package trigger provides scheduled and event-driven agent invocation.

The scheduler component uses cron expressions to trigger agents on a schedule without external HTTP requests.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AgentInvoker

type AgentInvoker func(ctx context.Context, agentName, input string) error

AgentInvoker is a function that invokes an agent with optional input.

type Scheduler

type Scheduler struct {
	// contains filtered or unexported fields
}

Scheduler manages scheduled agent invocations.

func NewScheduler

func NewScheduler(invoker AgentInvoker) *Scheduler

NewScheduler creates a new scheduler.

func (*Scheduler) RegisterAgent

func (s *Scheduler) RegisterAgent(agentName string, ag agent.Agent, cfg *config.TriggerConfig) error

RegisterAgent registers an agent's trigger with the scheduler.

func (*Scheduler) Start

func (s *Scheduler) Start()

Start begins the scheduler.

func (*Scheduler) Stop

func (s *Scheduler) Stop() context.Context

Stop gracefully stops the scheduler.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL