waits

package
v1.7.9 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2022 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const TypeDial string = "dial"

TypeDial is the type of our dial wait

View Source
const TypeMsg string = "msg"

TypeMsg is the type of our message wait

Variables

This section is empty.

Functions

func ReadWait

func ReadWait(data json.RawMessage) (flows.Wait, error)

ReadWait reads a wait from the given JSON

Types

type DialWait

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

DialWait is a wait which waits for a phone number to be dialed

func NewDialWait

func NewDialWait(phone string) *DialWait

NewDialWait creates a new Dial wait

func (*DialWait) Accepts

func (w *DialWait) Accepts(resume flows.Resume) bool

Accept returns whether this wait accepts the given resume

func (*DialWait) AllowedFlowTypes

func (w *DialWait) AllowedFlowTypes() []flows.FlowType

AllowedFlowTypes returns the flow types which this wait is allowed to occur in

func (*DialWait) Begin

func (w *DialWait) Begin(run flows.Run, log flows.EventCallback) bool

Begin beings waiting at this wait

func (*DialWait) MarshalJSON

func (w *DialWait) MarshalJSON() ([]byte, error)

MarshalJSON marshals this wait into JSON

func (*DialWait) Timeout

func (w *DialWait) Timeout() flows.Timeout

Timeout returns the timeout of this wait or nil if no timeout is set

func (*DialWait) Type

func (w *DialWait) Type() string

Type returns the type of this wait

type MsgWait

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

MsgWait is a wait which waits for an incoming message (i.e. a msg_received event)

func NewMsgWait

func NewMsgWait(timeout *Timeout, hint flows.Hint) *MsgWait

NewMsgWait creates a new message wait

func (*MsgWait) Accepts

func (w *MsgWait) Accepts(resume flows.Resume) bool

Accept returns whether this wait accepts the given resume

func (*MsgWait) AllowedFlowTypes

func (w *MsgWait) AllowedFlowTypes() []flows.FlowType

AllowedFlowTypes returns the flow types which this wait is allowed to occur in

func (*MsgWait) Begin

func (w *MsgWait) Begin(run flows.Run, log flows.EventCallback) bool

Begin beings waiting at this wait

func (*MsgWait) Hint

func (w *MsgWait) Hint() flows.Hint

Hint returns the hint (optional)

func (*MsgWait) MarshalJSON

func (w *MsgWait) MarshalJSON() ([]byte, error)

MarshalJSON marshals this wait into JSON

func (*MsgWait) Timeout

func (w *MsgWait) Timeout() flows.Timeout

Timeout returns the timeout of this wait or nil if no timeout is set

func (*MsgWait) Type

func (w *MsgWait) Type() string

Type returns the type of this wait

type Timeout

type Timeout struct {
	Seconds_      int                `json:"seconds"       validate:"required"`
	CategoryUUID_ flows.CategoryUUID `json:"category_uuid" validate:"required,uuid4"`
}

func NewTimeout

func NewTimeout(seconds int, categoryUUID flows.CategoryUUID) *Timeout

func (*Timeout) CategoryUUID

func (t *Timeout) CategoryUUID() flows.CategoryUUID

func (*Timeout) Seconds

func (t *Timeout) Seconds() int

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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