userinput

package
v0.7.6 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2024 License: Apache-2.0 Imports: 5 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Provides a mechanism for the backend to request user input from the frontend.

Index

Constants

View Source
const UserInputRequestStr = "userinputrequest"
View Source
const UserInputResponsePacketStr = "userinputresp"

Variables

This section is empty.

Functions

This section is empty.

Types

type UserInputRequestType

type UserInputRequestType struct {
	RequestId    string `json:"requestid"`
	QueryText    string `json:"querytext"`
	ResponseType string `json:"responsetype"`
	Title        string `json:"title"`
	Markdown     bool   `json:"markdown"`
	TimeoutMs    int    `json:"timeoutms"`
	CheckBoxMsg  string `json:"checkboxmsg"`
	PublicText   bool   `json:"publictext"`
}

An RpcPacket for requesting user input from the client

func (*UserInputRequestType) GetType

func (*UserInputRequestType) GetType() string

func (*UserInputRequestType) SetReqId

func (req *UserInputRequestType) SetReqId(reqId string)

func (*UserInputRequestType) SetTimeoutMs

func (req *UserInputRequestType) SetTimeoutMs(timeoutMs int)

type UserInputResponsePacketType

type UserInputResponsePacketType struct {
	Type         string `json:"type"`
	RequestId    string `json:"requestid"`
	Text         string `json:"text,omitempty"`
	Confirm      bool   `json:"confirm,omitempty"`
	ErrorMsg     string `json:"errormsg,omitempty"`
	CheckboxStat bool   `json:"checkboxstat,omitempty"`
}

An RpcResponse for user input requests

func GetUserInput

func GetUserInput(ctx context.Context, bus *scbus.RpcBus, userInputRequest *UserInputRequestType) (*UserInputResponsePacketType, error)

Send a user input request to the frontend and wait for a response

func (*UserInputResponsePacketType) GetError

func (pk *UserInputResponsePacketType) GetError() string

func (*UserInputResponsePacketType) GetType

func (*UserInputResponsePacketType) SetError

func (pk *UserInputResponsePacketType) SetError(err string)

Jump to

Keyboard shortcuts

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