mobile

package
v0.37.0 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2019 License: AGPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsLegacyDefinition added in v0.27.8

func IsLegacyDefinition(definition string) bool

IsLegacyDefinition peeks at the given flow definition to determine if it is in legacy format

func IsSpecVersionSupported

func IsSpecVersionSupported(ver string) bool

IsSpecVersionSupported returns whether the given flow spec version is supported

func MigrateLegacyDefinition added in v0.27.8

func MigrateLegacyDefinition(definition string) (string, error)

MigrateLegacyDefinition migrates a legacy definition

Types

type AssetsSource

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

AssetsSource is a static asset source

func NewAssetsSource

func NewAssetsSource(src string) (*AssetsSource, error)

NewAssetsSource creates a new static asset source

type Contact

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

Contact represents a person who is interacting with a flow

func NewEmptyContact

func NewEmptyContact(sa *SessionAssets) *Contact

NewEmptyContact creates a new contact

type Engine added in v0.27.4

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

func NewEngine added in v0.27.4

func NewEngine(httpUserAgent string) *Engine

func (*Engine) NewSession added in v0.27.4

func (e *Engine) NewSession(sa *SessionAssets) *Session

NewSession creates a new session

func (*Engine) ReadSession added in v0.27.4

func (e *Engine) ReadSession(a *SessionAssets, data string) (*Session, error)

ReadSession reads an existing session from JSON

type Environment

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

Environment defines the environment for expression evaluation etc

func NewEnvironment

func NewEnvironment(dateFormat string, timeFormat string, timezone string, defaultLanguage string, allowedLanguages *StringSlice, defaultCountry string, redactionPolicy string) (*Environment, error)

NewEnvironment creates a new environment.

type Event

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

func (*Event) Payload

func (e *Event) Payload() string

func (*Event) Type

func (e *Event) Type() string

type EventSlice

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

EventSlice wraps a slice of events

func NewEventSlice

func NewEventSlice(capacity int) *EventSlice

NewEventSlice creates a new slice of events

func (*EventSlice) Add

func (l *EventSlice) Add(item *Event)

Add adds an event to this slice

func (*EventSlice) Get

func (l *EventSlice) Get(index int) *Event

Get returns the event at the given index

func (*EventSlice) Length

func (l *EventSlice) Length() int

Length gets the length of this slice

type FlowReference

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

FlowReference is a reference to a flow

func NewFlowReference

func NewFlowReference(uuid string, name string) *FlowReference

NewFlowReference creates a new flow reference

type Hint

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

func (*Hint) Type

func (h *Hint) Type() string

type Modifier

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

func (*Modifier) Payload

func (m *Modifier) Payload() string

func (*Modifier) Type

func (m *Modifier) Type() string

type ModifierSlice

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

ModifierSlice wraps a slice of modifiers

func NewModifierSlice

func NewModifierSlice(capacity int) *ModifierSlice

NewModifierSlice creates a new slice of modifiers

func (*ModifierSlice) Add

func (l *ModifierSlice) Add(item *Modifier)

Add adds an event to this slice

func (*ModifierSlice) Get

func (l *ModifierSlice) Get(index int) *Modifier

Get returns the event at the given index

func (*ModifierSlice) Length

func (l *ModifierSlice) Length() int

Length gets the length of this slice

type MsgIn

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

MsgIn is an incoming message

func NewMsgIn

func NewMsgIn(uuid string, text string, attachments *StringSlice) *MsgIn

NewMsgIn creates a new incoming message

func (*MsgIn) Attachments

func (m *MsgIn) Attachments() *StringSlice

func (*MsgIn) Text

func (m *MsgIn) Text() string

type Resume

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

Resume represents something which can resume a session

func NewMsgResume

func NewMsgResume(environment *Environment, contact *Contact, msg *MsgIn) *Resume

NewMsgResume creates a new message resume

type Session

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

Session represents a session with the flow engine

func (*Session) Assets

func (s *Session) Assets() *SessionAssets

Assets returns the assets associated with this session

func (*Session) GetWait

func (s *Session) GetWait() *Wait

GetWait gets the current wait of this session.. can't call this Wait() because Object in Java already has a wait() method

func (*Session) Resume

func (s *Session) Resume(resume *Resume) (*Sprint, error)

Resume resumes this session

func (*Session) Start

func (s *Session) Start(trigger *Trigger) (*Sprint, error)

Start starts this session using the given trigger

func (*Session) Status

func (s *Session) Status() string

Status returns the status of this session

func (*Session) ToJSON

func (s *Session) ToJSON() (string, error)

ToJSON serializes this session as JSON

type SessionAssets

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

SessionAssets provides optimized access to assets

func NewSessionAssets

func NewSessionAssets(source *AssetsSource) (*SessionAssets, error)

NewSessionAssets creates a new session assets

type Sprint

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

Sprint is an interaction with the engine - i.e. a start or resume of a session

func (*Sprint) Events

func (s *Sprint) Events() *EventSlice

Events returns the events created during this sprint

func (*Sprint) Modifiers

func (s *Sprint) Modifiers() *ModifierSlice

Modifiers returns the modifiers created during this sprint

type StringSlice

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

StringSlice wraps a slice of strings

func NewStringSlice

func NewStringSlice(capacity int) *StringSlice

NewStringSlice creates a new string list

func (*StringSlice) Add

func (l *StringSlice) Add(item string)

Add adds an string to this slice

func (*StringSlice) Get

func (l *StringSlice) Get(index int) string

Get returns the string at the given index

func (*StringSlice) Length

func (l *StringSlice) Length() int

Length gets the length of this slice

type Trigger

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

Trigger represents something which can initiate a session

func NewManualTrigger

func NewManualTrigger(environment *Environment, contact *Contact, flow *FlowReference) *Trigger

NewManualTrigger creates a new manual trigger

type Wait

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

func (*Wait) Hint

func (w *Wait) Hint() *Hint

func (*Wait) Type

func (w *Wait) Type() string

Jump to

Keyboard shortcuts

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