Documentation ¶
Index ¶
- Constants
- Variables
- func AddStep(s *core.Session, step *core.Step)
- func DialStep(expect string) *core.Step
- func Execute()
- func ExecuteStep(s *core.Step, session *core.Session) (string, error)
- func InvalidComponentIdError(step *core.Step, session *core.Session) error
- func NewInteractiveSession(d core.DialogussConfig) *core.Session
- func NewStep(i int, text string, expect string) *core.Step
- func ResolveStepExpectedValue(s *core.Session, step *core.Step, store *ComponentStore) (string, error)
- func Run(s *core.Session, store *ComponentStore) error
- func RunInteractive(s *core.Session) error
- func UnexpectedResultError(want string, have string) error
- type ComponentStore
- type Dialoguss
- type DialogussCLI
- type Globals
- type PreviewCmd
- type RunCmd
- type SimulateCmd
- type VersionFlag
Constants ¶
const ( ApiTypeAfricastalking = "AT_USSD" ApiTypeTruroute = "TR_USSD" InteractiveDialTemplate = `Dialing app using: Phone: %s Url: %s SessionID:%s API Type: %s ` )
Variables ¶
var (
UssdCharacterLimit = 160
)
Functions ¶
func ExecuteStep ¶
Execute executes a step and returns the result of the request may return an empty string ("") upon failure
func InvalidComponentIdError ¶
func NewInteractiveSession ¶
func NewInteractiveSession(d core.DialogussConfig) *core.Session
NewInteractiveSession creates a new interactive session that should be run using RunInteractive
func ResolveStepExpectedValue ¶
func ResolveStepExpectedValue(s *core.Session, step *core.Step, store *ComponentStore) (string, error)
ResolveStepExpectedValue extracts step's expected value from the step or component store
func Run ¶
func Run(s *core.Session, store *ComponentStore) error
Run runs the dialoguss session and executes the steps in each session
func RunInteractive ¶
RunInteractive runs and interactive session that prompts ufor user input
func UnexpectedResultError ¶
UnexpectedResultError unexpected result from the USSD application
Types ¶
type ComponentStore ¶
type Dialoguss ¶
Dialoguss the main type for interacting with dialoguss sessions
func (*Dialoguss) GetComponents ¶
func (d *Dialoguss) GetComponents() (*ComponentStore, error)
func (*Dialoguss) LoadConfig ¶
LoadConfig loads configuration from YAML
func (*Dialoguss) RunAutomatedSessions ¶
RunAutomatedSessions Loads the sessions for this application
Returns number of failed sessions
type DialogussCLI ¶
type DialogussCLI struct { Globals Preview PreviewCmd `cmd:"" help:"Generate a preview of the dialoguss sessions using USSD Studio"` Run RunCmd `cmd:"" help:"Run a dialoguss test from a file"` Simulate SimulateCmd `cmd:"" help:"Simulate interaction with a USSD server in the command-line from a file"` }
type PreviewCmd ¶
type PreviewCmd struct {
ServerURL string `cmd:"" help:"Server URL for a USSD Studio server" default:"https://ussd-studio-api.nndi.cloud"`
}
func (*PreviewCmd) Run ¶
func (r *PreviewCmd) Run(globals *Globals) error
type SimulateCmd ¶
type SimulateCmd struct{}
func (*SimulateCmd) Run ¶
func (simCmd *SimulateCmd) Run(globals *Globals) error
type VersionFlag ¶
type VersionFlag string