trigger

package
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2026 License: MIT Imports: 6 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsTriggerType

func IsTriggerType(nodeType node.NodeType) bool

func MatchesExecution

func MatchesExecution(ctx context.Context, nodeType node.NodeType, config json.RawMessage, triggerType string) bool

func NormalizeWebhookMethod

func NormalizeWebhookMethod(method string) string

func NormalizeWebhookPath

func NormalizeWebhookPath(rawPath string) string

func WithChannelEvent

func WithChannelEvent(ctx context.Context, event ChannelEvent) context.Context

Types

type ChannelEvent

type ChannelEvent struct {
	ChannelID      string         `json:"channel_id"`
	ChannelName    string         `json:"channel_name"`
	ChannelType    string         `json:"channel_type"`
	ContactID      string         `json:"contact_id"`
	ExternalUserID string         `json:"external_user_id"`
	ExternalChatID string         `json:"external_chat_id"`
	Username       string         `json:"username,omitempty"`
	DisplayName    string         `json:"display_name,omitempty"`
	Text           string         `json:"text"`
	Message        map[string]any `json:"message,omitempty"`
}

func ChannelEventFromContext

func ChannelEventFromContext(ctx context.Context) (ChannelEvent, bool)

type ChannelMessageTrigger

type ChannelMessageTrigger struct{}

func (*ChannelMessageTrigger) Execute

func (e *ChannelMessageTrigger) Execute(ctx context.Context, config json.RawMessage, input map[string]any) (*node.NodeResult, error)

func (*ChannelMessageTrigger) Validate

func (e *ChannelMessageTrigger) Validate(config json.RawMessage) error

type CronTrigger

type CronTrigger struct{}

func (*CronTrigger) Execute

func (e *CronTrigger) Execute(ctx context.Context, config json.RawMessage, input map[string]any) (*node.NodeResult, error)

func (*CronTrigger) Validate

func (e *CronTrigger) Validate(config json.RawMessage) error

type ManualTrigger

type ManualTrigger struct{}

func (*ManualTrigger) Execute

func (e *ManualTrigger) Execute(ctx context.Context, config json.RawMessage, input map[string]any) (*node.NodeResult, error)

func (*ManualTrigger) Validate

func (e *ManualTrigger) Validate(config json.RawMessage) error

type WebhookConfig

type WebhookConfig struct {
	Path   string `json:"path"`
	Method string `json:"method"`
	Token  string `json:"token"`
}

func DecodeWebhookConfig

func DecodeWebhookConfig(config json.RawMessage) (WebhookConfig, error)

func NormalizeWebhookConfig

func NormalizeWebhookConfig(cfg WebhookConfig) (WebhookConfig, error)

type WebhookTrigger

type WebhookTrigger struct{}

func (*WebhookTrigger) Execute

func (e *WebhookTrigger) Execute(ctx context.Context, config json.RawMessage, input map[string]any) (*node.NodeResult, error)

func (*WebhookTrigger) Validate

func (e *WebhookTrigger) Validate(config json.RawMessage) error

Jump to

Keyboard shortcuts

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