triggers

package
v0.4.6 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2018 License: AGPL-3.0 Imports: 5 Imported by: 13

Documentation

Index

Constants

View Source
const TypeFlowAction string = "flow_action"

TypeFlowAction is a constant for sessions triggered by flow actions in other sessions

View Source
const TypeManual string = "manual"

TypeManual is the type for manually triggered sessions

Variables

This section is empty.

Functions

func NewManualTrigger

func NewManualTrigger(flow flows.Flow, triggeredOn time.Time) flows.Trigger

NewManualTrigger creates a new manual trigger

func ReadFlowActionTrigger

func ReadFlowActionTrigger(session flows.Session, envelope *utils.TypedEnvelope) (flows.Trigger, error)

func ReadManualTrigger

func ReadManualTrigger(session flows.Session, envelope *utils.TypedEnvelope) (flows.Trigger, error)

func ReadTrigger

func ReadTrigger(session flows.Session, envelope *utils.TypedEnvelope) (flows.Trigger, error)

Types

type FlowActionTrigger

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

FlowActionTrigger is used when another session triggered this run using a trigger_flow action.

```

{
  "type": "flow_action",
  "flow": {"uuid": "ea7d8b6b-a4b2-42c1-b9cf-c0370a95a721", "name": "Registration"},
  "triggered_on": "2000-01-01T00:00:00.000000000-00:00",
  "run": {
    "uuid": "b7cf0d83-f1c9-411c-96fd-c511a4cfa86d",
    "flow_uuid": "93c554a1-b90d-4892-b029-a2a87dec9b87",
    "contact": {
      "uuid": "c59b0033-e748-4240-9d4c-e85eb6800151",
      "name": "Bob",
      "fields": {"state": {"value": "Azuay", "created_on": "2000-01-01T00:00:00.000000000-00:00"}}
    },
    "status": "active",
    "results": {
      "age": {
        "result_name": "Age",
        "value": "33",
        "node": "cd2be8c4-59bc-453c-8777-dec9a80043b8",
        "created_on": "2000-01-01T00:00:00.000000000-00:00"
      }
    }
  }
}

```

func (*FlowActionTrigger) Flow

func (t *FlowActionTrigger) Flow() flows.Flow

func (*FlowActionTrigger) MarshalJSON

func (t *FlowActionTrigger) MarshalJSON() ([]byte, error)

func (*FlowActionTrigger) Run

func (*FlowActionTrigger) TriggeredOn

func (t *FlowActionTrigger) TriggeredOn() time.Time

func (*FlowActionTrigger) Type

func (t *FlowActionTrigger) Type() string

Type returns the type of this trigger

type ManualTrigger

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

ManualTrigger is used when a session was triggered manually by a user

```

{
  "type": "manual",
  "flow": {"uuid": "ea7d8b6b-a4b2-42c1-b9cf-c0370a95a721", "name": "Registration"},
  "triggered_on": "2000-01-01T00:00:00.000000000-00:00"
}

```

func (*ManualTrigger) Flow

func (t *ManualTrigger) Flow() flows.Flow

func (*ManualTrigger) MarshalJSON

func (t *ManualTrigger) MarshalJSON() ([]byte, error)

func (*ManualTrigger) TriggeredOn

func (t *ManualTrigger) TriggeredOn() time.Time

func (*ManualTrigger) Type

func (t *ManualTrigger) Type() string

Type returns the type of this trigger

Jump to

Keyboard shortcuts

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