Documentation ¶
Index ¶
- Variables
- func GroupReferenceValidation(sl validator.StructLevel)
- func LabelReferenceValidation(sl validator.StructLevel)
- func ValidateURN(fl validator.FieldLevel) bool
- func ValidateURNScheme(fl validator.FieldLevel) bool
- type Action
- type ActionUUID
- type Attachment
- type BaseMsg
- type Channel
- type ChannelReference
- type ChannelRole
- type ChannelSet
- type ChannelUUID
- type Contact
- func (c *Contact) AddURN(urn urns.URN) bool
- func (c *Contact) Clone() *Contact
- func (c *Contact) Default() interface{}
- func (c *Contact) Fields() FieldValues
- func (c *Contact) Groups() *GroupList
- func (c *Contact) HasURN(urn urns.URN) bool
- func (c *Contact) Language() utils.Language
- func (c *Contact) MarshalJSON() ([]byte, error)
- func (c *Contact) Name() string
- func (c *Contact) Reference() *ContactReference
- func (c *Contact) Resolve(key string) interface{}
- func (c *Contact) ResolveQueryKey(key string) []interface{}
- func (c *Contact) SetLanguage(lang utils.Language)
- func (c *Contact) SetName(name string)
- func (c *Contact) SetTimezone(tz *time.Location)
- func (c *Contact) String() string
- func (c *Contact) Timezone() *time.Location
- func (c *Contact) URNs() URNList
- func (c *Contact) UUID() ContactUUID
- func (c *Contact) UpdateDynamicGroups(session Session) error
- func (c *Contact) UpdatePreferredChannel(channel Channel)
- type ContactReference
- type ContactURN
- type ContactUUID
- type Event
- type EventLog
- type EventOrigin
- type Exit
- type ExitUUID
- type Field
- type FieldKey
- type FieldReference
- type FieldSet
- type FieldValue
- type FieldValueType
- type FieldValues
- type Flow
- type FlowReference
- type FlowRun
- type FlowUUID
- type Group
- func (g *Group) CheckDynamicMembership(session Session, contact *Contact) (bool, error)
- func (g *Group) Default() interface{}
- func (g *Group) IsDynamic() bool
- func (g *Group) Name() string
- func (g *Group) ParsedQuery() (*contactql.ContactQuery, error)
- func (g *Group) Query() string
- func (g *Group) Reference() *GroupReference
- func (g *Group) Resolve(key string) interface{}
- func (g *Group) String() string
- func (g *Group) UUID() GroupUUID
- type GroupList
- func (l *GroupList) Add(group *Group) bool
- func (l *GroupList) All() []*Group
- func (l *GroupList) Clone() *GroupList
- func (l *GroupList) Count() int
- func (l GroupList) Default() interface{}
- func (l *GroupList) FindByUUID(uuid GroupUUID) *Group
- func (l *GroupList) Remove(group *Group) bool
- func (l *GroupList) Resolve(key string) interface{}
- func (l GroupList) String() string
- type GroupReference
- type GroupSet
- type GroupUUID
- type Input
- type InputUUID
- type Label
- type LabelReference
- type LabelSet
- type LabelUUID
- type Localization
- type MsgIn
- type MsgOut
- type MsgUUID
- type Node
- type NodeUUID
- type Result
- type Results
- type Route
- type Router
- type RunStatus
- type RunSummary
- type RunUUID
- type Session
- type SessionAssets
- type SessionStatus
- type Step
- type StepUUID
- type Translations
- type Trigger
- type URNList
- type Wait
Constants ¶
This section is empty.
Variables ¶
var NoRoute = Route{}
Functions ¶
func GroupReferenceValidation ¶ added in v0.4.0
func GroupReferenceValidation(sl validator.StructLevel)
GroupReferenceValidation validates that the given group reference is either a concrete reference or a name matcher
func LabelReferenceValidation ¶ added in v0.4.0
func LabelReferenceValidation(sl validator.StructLevel)
LabelReferenceValidation validates that the given label reference is either a concrete reference or a name matcher
func ValidateURN ¶ added in v0.4.0
func ValidateURN(fl validator.FieldLevel) bool
ValidateURN validates whether the field value is a valid URN
func ValidateURNScheme ¶ added in v0.4.0
func ValidateURNScheme(fl validator.FieldLevel) bool
ValidateURNScheme validates whether the field value is a valid URN scheme
Types ¶
type Action ¶
type Action interface { UUID() ActionUUID Execute(FlowRun, Step, EventLog) error Validate(SessionAssets) error utils.Typed }
Action is an action within a flow node
type ActionUUID ¶
ActionUUID is the UUID of an action
func (ActionUUID) String ¶
func (u ActionUUID) String() string
type Attachment ¶ added in v0.4.0
type Attachment string
Attachment is a media attachment on a message
func (Attachment) ContentType ¶ added in v0.4.0
func (a Attachment) ContentType() string
ContentType returns the MIME type of this attachment
func (Attachment) Default ¶ added in v0.4.0
func (a Attachment) Default() interface{}
Default returns the value of this attachment when it is the result of an expression
func (Attachment) Resolve ¶ added in v0.4.0
func (a Attachment) Resolve(key string) interface{}
Resolve resolves the given key when this attachment is referenced in an expression
func (Attachment) String ¶ added in v0.4.0
func (a Attachment) String() string
func (Attachment) URL ¶ added in v0.4.0
func (a Attachment) URL() string
URL returns the full URL of this attachment
type BaseMsg ¶ added in v0.6.0
type BaseMsg struct { UUID_ MsgUUID `json:"uuid"` URN_ urns.URN `json:"urn" validate:"required"` Channel_ *ChannelReference `json:"channel,omitempty"` Text_ string `json:"text"` Attachments_ []Attachment `json:"attachments,omitempty"` }
BaseMsg represents a incoming or outgoing message with the session contact
func (*BaseMsg) Attachments ¶ added in v0.6.0
func (m *BaseMsg) Attachments() []Attachment
Attachments returns the attachments of this message
func (*BaseMsg) Channel ¶ added in v0.6.0
func (m *BaseMsg) Channel() *ChannelReference
Channel returns the channel of this message
type Channel ¶
type Channel interface { UUID() ChannelUUID Name() string Address() string Schemes() []string SupportsScheme(string) bool Roles() []ChannelRole HasRole(ChannelRole) bool Reference() *ChannelReference }
Channel represents a channel for sending and receiving messages
func NewChannel ¶ added in v0.6.0
func NewChannel(uuid ChannelUUID, name string, address string, schemes []string, roles []ChannelRole) Channel
NewChannel creates a new channel
func ReadChannel ¶
func ReadChannel(data json.RawMessage) (Channel, error)
ReadChannel decodes a channel from the passed in JSON
type ChannelReference ¶ added in v0.4.0
type ChannelReference struct { UUID ChannelUUID `json:"uuid" validate:"required,uuid4"` Name string `json:"name"` }
ChannelReference is used to reference a channel
func NewChannelReference ¶ added in v0.4.0
func NewChannelReference(uuid ChannelUUID, name string) *ChannelReference
NewChannelReference creates a new channel reference with the given UUID and name
type ChannelRole ¶ added in v0.6.0
type ChannelRole string
ChannelRole is a role that a channel can perform
const ( ChannelRoleSend ChannelRole = "send" ChannelRoleReceive ChannelRole = "receive" ChannelRoleCall ChannelRole = "call" ChannelRoleAnswer ChannelRole = "answer" ChannelRoleUSSD ChannelRole = "ussd" )
different roles that channels can perform
type ChannelSet ¶ added in v0.6.0
type ChannelSet struct {
// contains filtered or unexported fields
}
ChannelSet defines the unordered set of all channels for a session
func NewChannelSet ¶ added in v0.6.0
func NewChannelSet(channels []Channel) *ChannelSet
NewChannelSet creates a new channel set
func ReadChannelSet ¶ added in v0.6.0
func ReadChannelSet(data json.RawMessage) (*ChannelSet, error)
ReadChannelSet decodes channels from the passed in JSON
func (*ChannelSet) FindByUUID ¶ added in v0.6.0
func (s *ChannelSet) FindByUUID(uuid ChannelUUID) Channel
FindByUUID finds the channel with the given UUID
func (*ChannelSet) GetForURN ¶ added in v0.6.0
func (s *ChannelSet) GetForURN(urn *ContactURN) Channel
GetForURN returns the best channel for the given URN
type ChannelUUID ¶
ChannelUUID is the UUID of a channel
func (ChannelUUID) String ¶
func (u ChannelUUID) String() string
type Contact ¶
type Contact struct {
// contains filtered or unexported fields
}
Contact represents a single contact
func NewContact ¶ added in v0.5.1
func NewContact(uuid ContactUUID, name string, language utils.Language, timezone *time.Location) *Contact
NewContact returns a new contact
func ReadContact ¶
func ReadContact(session Session, data json.RawMessage) (*Contact, error)
ReadContact decodes a contact from the passed in JSON
func (*Contact) Default ¶
func (c *Contact) Default() interface{}
Default returns the value of this contact when it is the result of an expression
func (*Contact) Fields ¶
func (c *Contact) Fields() FieldValues
Fields returns this contact's field values
func (*Contact) MarshalJSON ¶
MarshalJSON marshals this contact into JSON
func (*Contact) Reference ¶ added in v0.4.0
func (c *Contact) Reference() *ContactReference
Reference returns a reference to this contact
func (*Contact) Resolve ¶
Resolve resolves the given key when this contact is referenced in an expression
func (*Contact) ResolveQueryKey ¶ added in v0.4.0
ResolveQueryKey resolves a contact query search key for this contact
func (*Contact) SetLanguage ¶
SetLanguage sets the language for this contact
func (*Contact) SetTimezone ¶
SetTimezone sets the timezone of this contact
func (*Contact) UpdateDynamicGroups ¶ added in v0.4.0
UpdateDynamicGroups reevaluates membership of all dynamic groups for this contact
func (*Contact) UpdatePreferredChannel ¶ added in v0.6.0
UpdatePreferredChannel updates the preferred channel
type ContactReference ¶
type ContactReference struct { UUID ContactUUID `json:"uuid" validate:"required,uuid4"` Name string `json:"name"` }
ContactReference is used to reference a contact
func NewContactReference ¶ added in v0.4.0
func NewContactReference(uuid ContactUUID, name string) *ContactReference
NewContactReference creates a new contact reference with the given UUID and name
type ContactURN ¶ added in v0.6.0
ContactURN holds a URN for a contact with the channel parsed out
func NewContactURN ¶ added in v0.6.0
func NewContactURN(urn urns.URN, channel Channel) *ContactURN
NewContactURN creates a new contact URN with associated channel
func (*ContactURN) Channel ¶ added in v0.6.0
func (u *ContactURN) Channel() Channel
Channel gets the channel associated with this URN
func (*ContactURN) Default ¶ added in v0.6.0
func (u *ContactURN) Default() interface{}
Default returns the value of this URN when it is the result of an expression
func (*ContactURN) Resolve ¶ added in v0.6.0
func (u *ContactURN) Resolve(key string) interface{}
Resolve resolves the given key when this URN is referenced in an expression
func (*ContactURN) SetChannel ¶ added in v0.6.0
func (u *ContactURN) SetChannel(channel Channel)
SetChannel sets the channel associated with this URN
func (*ContactURN) String ¶ added in v0.6.0
func (u *ContactURN) String() string
type ContactUUID ¶
ContactUUID is the UUID of a contact
func (ContactUUID) String ¶
func (u ContactUUID) String() string
type Event ¶
type Event interface { CreatedOn() time.Time SetCreatedOn(time.Time) StepUUID() StepUUID SetStepUUID(StepUUID) FromCaller() bool SetFromCaller(bool) AllowedOrigin() EventOrigin Validate(SessionAssets) error Apply(FlowRun) error utils.Typed }
Event describes a state change
type EventOrigin ¶ added in v0.6.0
type EventOrigin int
EventOrigin is the allowed origin of an event
const ( // EventOriginCaller means an event can originate from the caller EventOriginCaller EventOrigin = 1 // EventOriginEngine means an event can originate from the engine EventOriginEngine EventOrigin = 2 )
type Field ¶
type Field struct {
// contains filtered or unexported fields
}
Field represents a contact field
func NewField ¶ added in v0.4.0
func NewField(key FieldKey, label string, valueType FieldValueType) *Field
NewField returns a new field object with the passed in uuid, key and value type
func ReadField ¶ added in v0.4.0
func ReadField(data json.RawMessage) (*Field, error)
ReadField reads a contact field from the given JSON
func (*Field) ParseValue ¶ added in v0.4.0
func (f *Field) ParseValue(env utils.Environment, value string) (interface{}, error)
ParseValue returns a parsed field value for the given input
type FieldReference ¶ added in v0.4.0
type FieldReference struct { Key FieldKey `json:"key" validate:"required"` Label string `json:"label"` }
FieldReference is a reference to field
func NewFieldReference ¶ added in v0.4.0
func NewFieldReference(key FieldKey, label string) *FieldReference
NewFieldReference creates a new field reference with the given key and label
type FieldSet ¶ added in v0.4.0
type FieldSet struct {
// contains filtered or unexported fields
}
FieldSet defines the unordered set of all fields for a session
func NewFieldSet ¶ added in v0.4.0
NewFieldSet creates a new set of fields
func ReadFieldSet ¶ added in v0.4.0
func ReadFieldSet(data json.RawMessage) (*FieldSet, error)
ReadFieldSet reads a set of contact fields from the given JSON
type FieldValue ¶ added in v0.4.0
type FieldValue struct {
// contains filtered or unexported fields
}
FieldValue represents a contact's value for a specific field
func NewFieldValue ¶ added in v0.4.0
func NewFieldValue(field *Field, value interface{}, createdOn time.Time) *FieldValue
NewFieldValue creates a new field value
func (*FieldValue) Default ¶ added in v0.4.0
func (v *FieldValue) Default() interface{}
Default returns the value of this field value when it is the result of an expression
func (*FieldValue) Resolve ¶ added in v0.4.0
func (v *FieldValue) Resolve(key string) interface{}
Resolve resolves the given key when this field value is referenced in an expression
func (*FieldValue) SerializeValue ¶ added in v0.4.0
func (v *FieldValue) SerializeValue() string
SerializeValue returns the string representation of this field value for serialization
func (*FieldValue) String ¶ added in v0.4.0
func (v *FieldValue) String() string
String returns the string representation of this field value
type FieldValueType ¶ added in v0.4.0
type FieldValueType string
FieldValueType is the data type of values for each field
const ( FieldValueTypeText FieldValueType = "text" FieldValueTypeNumeric FieldValueType = "numeric" FieldValueTypeDatetime FieldValueType = "datetime" FieldValueTypeWard FieldValueType = "ward" FieldValueTypeDistrict FieldValueType = "district" FieldValueTypeState FieldValueType = "state" )
field value types
type FieldValues ¶ added in v0.4.0
type FieldValues map[FieldKey]*FieldValue
FieldValues is the set of all field values for a contact
func (FieldValues) Clone ¶ added in v0.4.0
func (f FieldValues) Clone() FieldValues
Clone returns a clone of this set of field values
func (FieldValues) Default ¶ added in v0.4.0
func (f FieldValues) Default() interface{}
Default returns the value of this set of field values when it is the result of an expression
func (FieldValues) Resolve ¶ added in v0.4.0
func (f FieldValues) Resolve(key string) interface{}
Resolve resolves the given key when this set of field values is referenced in an expression
func (FieldValues) Save ¶ added in v0.4.0
func (f FieldValues) Save(env utils.Environment, field *Field, rawValue string) error
Save saves a new field value
func (FieldValues) String ¶ added in v0.4.0
func (f FieldValues) String() string
String returns the string representation of these Fields, which is our JSON representation
type Flow ¶
type Flow interface { UUID() FlowUUID Name() string Language() utils.Language ExpireAfterMinutes() int Localization() Localization Validate(SessionAssets) error Nodes() []Node GetNode(uuid NodeUUID) Node Reference() *FlowReference }
Flow is a graph of nodes containing actions and routers
type FlowReference ¶ added in v0.4.0
type FlowReference struct { UUID FlowUUID `json:"uuid" validate:"uuid4"` Name string `json:"name"` }
FlowReference is used to reference a flow from another flow
func NewFlowReference ¶ added in v0.4.0
func NewFlowReference(uuid FlowUUID, name string) *FlowReference
NewFlowReference creates a new flow reference with the given UUID and name
type FlowRun ¶
type FlowRun interface { RunSummary Environment() utils.Environment Session() Session Context() utils.VariableResolver Input() Input Webhook() *utils.RequestResponse SetContact(*Contact) SetInput(Input) SetStatus(RunStatus) SetWebhook(*utils.RequestResponse) ApplyEvent(Step, Action, Event) error AddError(Step, Action, error) AddFatalError(Step, Action, error) CreateStep(Node) Step Path() []Step PathLocation() (Step, Node, error) GetText(utils.UUID, string, string) string GetTextArray(utils.UUID, string, []string) []string GetTranslatedTextArray(utils.UUID, string, []string, utils.LanguageList) []string Snapshot() RunSummary Parent() RunSummary SessionParent() FlowRun Ancestors() []FlowRun CreatedOn() time.Time ExpiresOn() *time.Time ResetExpiration(*time.Time) ExitedOn() *time.Time Exit(RunStatus) }
FlowRun represents a run in the current session
type Group ¶
type Group struct {
// contains filtered or unexported fields
}
Group represents a grouping of contacts
func ReadGroup ¶ added in v0.4.0
func ReadGroup(data json.RawMessage) (*Group, error)
ReadGroup reads a group from the given JSON
func (*Group) CheckDynamicMembership ¶ added in v0.4.0
CheckDynamicMembership returns whether the given contact belongs in this dynamic group
func (*Group) Default ¶
func (g *Group) Default() interface{}
Default returns the value of this group when it is the result of an expression
func (*Group) ParsedQuery ¶ added in v0.4.0
func (g *Group) ParsedQuery() (*contactql.ContactQuery, error)
ParsedQuery returns the parsed query of a dynamic group (cached)
func (*Group) Reference ¶ added in v0.4.0
func (g *Group) Reference() *GroupReference
Reference returns a reference to this group
func (*Group) Resolve ¶
Resolve resolves the given key when this group is referenced in an expression
type GroupList ¶
type GroupList struct {
// contains filtered or unexported fields
}
GroupList defines a contact's list of groups
func NewGroupList ¶ added in v0.4.0
NewGroupList creates a new group list
func (GroupList) Default ¶
func (l GroupList) Default() interface{}
Default returns the value of this group list when it is the result of an expression
func (*GroupList) FindByUUID ¶ added in v0.4.0
FindByUUID returns the group with the passed in UUID or nil if not found
type GroupReference ¶ added in v0.4.0
type GroupReference struct { UUID GroupUUID `json:"uuid,omitempty" validate:"omitempty,uuid4"` Name string `json:"name,omitempty"` NameMatch string `json:"name_match,omitempty"` }
GroupReference is used to reference a group
func NewGroupReference ¶ added in v0.4.0
func NewGroupReference(uuid GroupUUID, name string) *GroupReference
NewGroupReference creates a new group reference with the given UUID and name
func NewVariableGroupReference ¶ added in v0.4.0
func NewVariableGroupReference(nameMatch string) *GroupReference
NewVariableGroupReference creates a new group reference from the given templatized name match
type GroupSet ¶ added in v0.4.0
type GroupSet struct {
// contains filtered or unexported fields
}
GroupSet defines the unordered set of all groups for a session
func NewGroupSet ¶ added in v0.4.0
NewGroupSet creates a new group set from the given list of groups
func ReadGroupSet ¶ added in v0.4.0
func ReadGroupSet(data json.RawMessage) (*GroupSet, error)
ReadGroupSet reads a group set from the given JSON
func (*GroupSet) FindByName ¶ added in v0.4.0
FindByName looks for a group with the given name (case-insensitive)
func (*GroupSet) FindByUUID ¶ added in v0.4.0
FindByUUID finds the group with the given UUID
type Label ¶
type Label struct {
// contains filtered or unexported fields
}
Label represents a message label
func ReadLabel ¶ added in v0.4.0
func ReadLabel(data json.RawMessage) (*Label, error)
ReadLabel reads a label from the given JSON
func (*Label) Reference ¶ added in v0.4.0
func (l *Label) Reference() *LabelReference
Reference returns a reference to this label
type LabelReference ¶ added in v0.4.0
type LabelReference struct { UUID LabelUUID `json:"uuid,omitempty" validate:"omitempty,uuid4"` Name string `json:"name,omitempty"` NameMatch string `json:"name_match,omitempty"` }
LabelReference is used to reference a label
func NewLabelReference ¶ added in v0.4.0
func NewLabelReference(uuid LabelUUID, name string) *LabelReference
NewLabelReference creates a new label reference with the given UUID and name
func NewVariableLabelReference ¶ added in v0.4.0
func NewVariableLabelReference(nameMatch string) *LabelReference
NewVariableLabelReference creates a new label reference from the given templatized name match
type LabelSet ¶ added in v0.4.0
type LabelSet struct {
// contains filtered or unexported fields
}
LabelSet defines the unordered set of all labels for a session
func NewLabelSet ¶ added in v0.4.0
NewLabelSet creates a new label set from the given slice of labels
func ReadLabelSet ¶ added in v0.4.0
func ReadLabelSet(data json.RawMessage) (*LabelSet, error)
ReadLabelSet reads a label set from the given JSON
func (*LabelSet) FindByName ¶ added in v0.4.0
FindByName looks for a label with the given name (case-insensitive)
func (*LabelSet) FindByUUID ¶ added in v0.4.0
FindByUUID finds the label with the given UUID
type Localization ¶ added in v0.6.2
type Localization interface { AddItemTranslation(utils.Language, utils.UUID, string, []string) GetTranslations(utils.Language) Translations Languages() utils.LanguageList }
Localization provide a way to get the translations for a specific language
type MsgIn ¶
type MsgIn struct {
BaseMsg
}
MsgIn represents a incoming message from the session contact
type MsgOut ¶
MsgOut represents a outgoing message to the session contact
func NewMsgOut ¶ added in v0.6.0
func NewMsgOut(urn urns.URN, channel Channel, text string, attachments []Attachment, quickReplies []string) *MsgOut
NewMsgOut creates a new outgoing message
func (*MsgOut) QuickReplies ¶ added in v0.6.0
QuickReplies returns the quick replies of this outgoing message
type Node ¶
type Node interface { UUID() NodeUUID Router() Router Actions() []Action Exits() []Exit Wait() Wait }
Node is a single node in a flow
type Result ¶
type Result struct { Name string `json:"name"` Value string `json:"value"` Category string `json:"category,omitempty"` CategoryLocalized string `json:"category_localized,omitempty"` NodeUUID NodeUUID `json:"node_uuid"` Input string `json:"input"` CreatedOn time.Time `json:"created_on"` }
Result represents a result value in our flow run. Results have a name for which they are the result for, the value itself of the result, optional category and the date and node the result was collected on
func (*Result) Default ¶
func (r *Result) Default() interface{}
Default returns the value of this result when it is the result of an expression
type Results ¶
Results is our wrapper around a map of snakified result names to result objects
func (Results) Default ¶
func (r Results) Default() interface{}
Default returns the value of this result set when it is the result of an expression
type RunStatus ¶
type RunStatus string
RunStatus represents the current status of the flow run
const ( // RunStatusActive represents a run that is still active RunStatusActive RunStatus = "active" // RunStatusCompleted represents a run that has run to completion RunStatusCompleted RunStatus = "completed" // RunStatusWaiting represents a run which is waiting for something from the caller RunStatusWaiting RunStatus = "waiting" // RunStatusErrored represents a run that encountered an error RunStatusErrored RunStatus = "errored" // RunStatusExpired represents a run that expired due to inactivity RunStatusExpired RunStatus = "expired" // RunStatusInterrupted represents a run that was interrupted by another flow RunStatusInterrupted RunStatus = "interrupted" )
type RunSummary ¶ added in v0.4.0
type RunSummary interface { UUID() RunUUID Contact() *Contact Flow() Flow Status() RunStatus Results() Results }
RunSummary represents the minimum information available about all runs (current or related) and is the representation of runs made accessible to router tests.
func NewRunSummaryFromRun ¶ added in v0.4.0
func NewRunSummaryFromRun(run FlowRun) RunSummary
NewRunSummaryFromRun creates a new run summary from the given run
func ReadRunSummary ¶ added in v0.4.0
func ReadRunSummary(session Session, data json.RawMessage) (RunSummary, error)
ReadRunSummary reads a run summary from the given JSON
type Session ¶
type Session interface { Assets() SessionAssets Environment() utils.Environment SetEnvironment(utils.Environment) Contact() *Contact SetContact(*Contact) Status() SessionStatus Trigger() Trigger PushFlow(Flow, FlowRun) Wait() Wait FlowOnStack(FlowUUID) bool Start(Trigger, []Event) error Resume([]Event) error Runs() []FlowRun GetRun(RunUUID) (FlowRun, error) GetCurrentChild(FlowRun) FlowRun Events() []Event LogEvent(Event) }
Session represents the session of a flow run which may contain many runs
type SessionAssets ¶ added in v0.4.0
type SessionAssets interface { GetChannel(ChannelUUID) (Channel, error) GetChannelSet() (*ChannelSet, error) GetField(FieldKey) (*Field, error) GetFieldSet() (*FieldSet, error) GetFlow(FlowUUID) (Flow, error) GetGroup(GroupUUID) (*Group, error) GetGroupSet() (*GroupSet, error) GetLabel(LabelUUID) (*Label, error) GetLabelSet() (*LabelSet, error) HasLocations() bool GetLocationHierarchy() (*utils.LocationHierarchy, error) }
SessionAssets is the assets available to a session
type SessionStatus ¶ added in v0.4.0
type SessionStatus string
SessionStatus represents the current status of the engine session
const ( // SessionStatusActive represents a session that is still active SessionStatusActive SessionStatus = "active" // SessionStatusCompleted represents a session that has run to completion SessionStatusCompleted SessionStatus = "completed" // SessionStatusWaiting represents a session which is waiting for something from the caller SessionStatusWaiting SessionStatus = "waiting" // SessionStatusErrored represents a session that encountered an error SessionStatusErrored SessionStatus = "errored" )
func (SessionStatus) String ¶ added in v0.4.0
func (r SessionStatus) String() string
type Translations ¶
Translations provide a way to get the translation for a specific language for a uuid/key pair
type Trigger ¶ added in v0.4.0
type Trigger interface { utils.VariableResolver utils.Typed Environment() utils.Environment Flow() Flow Contact() *Contact Params() utils.JSONFragment TriggeredOn() time.Time }
type URNList ¶
type URNList []*ContactURN
URNList is the list of a contact's URNs
func ReadURNList ¶ added in v0.6.0
ReadURNList parses contact URN list from the given list of raw URNs
func (URNList) Default ¶
func (l URNList) Default() interface{}
Default returns the value of this URN list when it is the result of an expression
func (URNList) RawURNs ¶ added in v0.6.0
RawURNs returns the raw URNs with or without channel information
func (URNList) Resolve ¶
Resolve resolves the given key when this URN list is referenced in an expression
func (URNList) WithScheme ¶ added in v0.4.4
WithScheme returns a new URN list containing of only URNs of the given scheme