inputs

package
v0.67.1 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2020 License: AGPL-3.0 Imports: 10 Imported by: 3

Documentation

Index

Constants

View Source
const TypeMsg string = "msg"

TypeMsg is a constant for incoming messages

Variables

This section is empty.

Functions

func ReadInput added in v0.4.0

func ReadInput(sessionAssets flows.SessionAssets, data json.RawMessage, missing assets.MissingCallback) (flows.Input, error)

ReadInput reads an input from the given typed envelope

Types

type MsgInput added in v0.4.0

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

MsgInput is a message which can be used as input

func NewMsg added in v0.48.0

func NewMsg(assets flows.SessionAssets, msg *flows.MsgIn, createdOn time.Time) (*MsgInput, error)

NewMsg creates a new user input based on a message

func (*MsgInput) Channel added in v0.4.0

func (i *MsgInput) Channel() *flows.Channel

func (*MsgInput) Context added in v0.33.8

func (i *MsgInput) Context(env envs.Environment) map[string]types.XValue

Context returns the properties available in expressions

__default__:text -> the text and attachments
uuid:text -> the UUID of the input
created_on:datetime -> the creation date of the input
channel:channel -> the channel that the input was received on
urn:text -> the contact URN that the input was received on
text:text -> the text part of the input
attachments:[]text -> any attachments on the input
external_id:text -> the external ID of the input

@context input

func (*MsgInput) CreatedOn added in v0.4.0

func (i *MsgInput) CreatedOn() time.Time

func (*MsgInput) MarshalJSON added in v0.4.0

func (i *MsgInput) MarshalJSON() ([]byte, error)

MarshalJSON marshals this msg input into JSON

func (*MsgInput) Type added in v0.4.0

func (i *MsgInput) Type() string

Type returns the type of this input

func (*MsgInput) UUID added in v0.4.0

func (i *MsgInput) UUID() flows.InputUUID

Jump to

Keyboard shortcuts

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