mobile

package
v0.214.3 Latest Latest
Warning

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

Go to latest
Published: May 21, 2024 License: AGPL-3.0, AGPL-3.0-or-later Imports: 17 Imported by: 0

README

To build an Android Archive you will need to have a suitable Android NDK installed and ANDROID_NDK_HOME env variable set, e.g.

export ANDROID_NDK_HOME=/Users/rowan/Library/Android/sdk/ndk/22.1.7171670

To create the AAR run:

go get golang.org/x/mobile/cmd/gomobile
gomobile init
gomobile bind -target android -javapkg=com.nyaruka.goflow -o mobile/goflow.aar github.com/nyaruka/goflow/mobile

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CurrentSpecVersion added in v0.38.3

func CurrentSpecVersion() string

CurrentSpecVersion returns the current flow spec version

func IsVersionSupported added in v0.66.2

func IsVersionSupported(version string) bool

IsVersionSupported returns whether the given spec version is supported

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() *Engine

func (*Engine) NewSession added in v0.27.4

func (e *Engine) NewSession(sa *SessionAssets, trigger *Trigger) (*SessionAndSprint, error)

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, 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 MsgWaitEvent added in v0.178.2

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

func (*MsgWaitEvent) Hint added in v0.178.2

func (e *MsgWaitEvent) Hint() *Hint

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) Resume

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

Resume resumes this session

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 SessionAndSprint added in v0.38.0

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

SessionAndSprint holds a session and a sprint.. because a Java method can't return two values

func (*SessionAndSprint) Session added in v0.38.0

func (ss *SessionAndSprint) Session() *Session

func (*SessionAndSprint) Sprint added in v0.38.0

func (ss *SessionAndSprint) Sprint() *Sprint

type SessionAssets

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

SessionAssets provides optimized access to assets

func NewSessionAssets

func NewSessionAssets(environment *Environment, 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

func (*Sprint) MsgWaitEvent added in v0.178.2

func (s *Sprint) MsgWaitEvent() *MsgWaitEvent

MsgWaitEvent returns the first msg wait event if there is one

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

Jump to

Keyboard shortcuts

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