Documentation
¶
Index ¶
- func IsTriggerType(nodeType node.NodeType) bool
- func MatchesExecution(ctx context.Context, nodeType node.NodeType, config json.RawMessage, ...) bool
- func NormalizeWebhookMethod(method string) string
- func NormalizeWebhookPath(rawPath string) string
- func WithChannelEvent(ctx context.Context, event ChannelEvent) context.Context
- type ChannelEvent
- type ChannelMessageTrigger
- type CronTrigger
- type ManualTrigger
- type WebhookConfig
- type WebhookTrigger
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsTriggerType ¶
func MatchesExecution ¶
func NormalizeWebhookMethod ¶
func NormalizeWebhookPath ¶
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
Click to show internal directories.
Click to hide internal directories.