page

package
v0.0.0-...-60b7a90 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2025 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// RegisterWebClientAction registers WS client as web (browser) client
	RegisterWebClientAction = "registerWebClient"

	// RegisterHostClientAction registers WS client as host (script) client
	RegisterHostClientAction = "registerHostClient"

	// SessionCreatedAction notifies host clients about new sessions
	SessionCreatedAction = "sessionCreated"

	// PageCommandFromHostAction adds, sets, gets, disconnects or performs other page-related command from host
	PageCommandFromHostAction = "pageCommandFromHost"

	// PageCommandFromHostAction adds, sets, gets, disconnects or performs other page-related command from host
	PageCommandsBatchFromHostAction = "pageCommandsBatchFromHost"

	// PageEventFromWebAction receives click, change, expand/collapse and other events from browser
	PageEventFromWebAction = "pageEventFromWeb"

	// PageEventToHostAction redirects events from web to host clients
	PageEventToHostAction = "pageEventToHost"

	AddPageControlsAction = "addPageControls"

	ReplacePageControlsAction = "replacePageControls"

	UpdateControlPropsAction = "updateControlProps"

	AppendControlPropsAction = "appendControlProps"

	RemoveControlAction = "removeControl"

	CleanControlAction = "cleanControl"

	PageControlsBatchAction = "pageControlsBatch"

	AppBecomeActiveAction = "appBecomeActive"

	AppBecomeInactiveAction = "appBecomeInactive"

	SessionCrashedAction = "sessionCrashed"

	InvokeMethodAction = "invokeMethod"
)
View Source
const (
	// ZeroSession is ID of zero session
	ZeroSession string = "0"
	// ControlAutoIDPrefix is a prefix for auto-generated control IDs
	ControlAutoIDPrefix = "_"
	// ControlIDSeparator is a symbol between parts of control ID
	ControlIDSeparator = ":"
	// ReservedPageID is a reserved page ID
	ReservedPageID = "page"
)

Variables

This section is empty.

Functions

func ClientChannelName

func ClientChannelName(clientID string) string

func GetUploadQueryString

func GetUploadQueryString(fileName string, expireStr string) string

func GetUploadSignature

func GetUploadSignature(queryString string) string

func GetUploadUrl

func GetUploadUrl(fileName string, expiresInSeconds int) string

func NewMessageData

func NewMessageData(id string, action string, payload interface{}) []byte

func RunBackgroundTasks

func RunBackgroundTasks(ctx context.Context)

Types

type AddPageControlsPayload

type AddPageControlsPayload struct {
	Controls []*model.Control `json:"controls"`
	TrimIDs  []string         `json:"trimIDs"`
}

type AppBecomeActivePayload

type AppBecomeActivePayload struct {
}

type AppBecomeInactivePayload

type AppBecomeInactivePayload struct {
	Message string `json:"message"`
}

type AppendControlPropsPayload

type AppendControlPropsPayload struct {
	Props []map[string]string `json:"props"`
}

type CleanControlPayload

type CleanControlPayload struct {
	IDs []string `json:"ids"`
}

type Client

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

func NewClient

func NewClient(conn connection.Conn, clientIP string, clientUserAgent string) *Client

type ClientRole

type ClientRole string
const (
	None       ClientRole = "None"
	WebClient  ClientRole = "Web"
	HostClient ClientRole = "Host"
)

type InactiveAppRequestPayload

type InactiveAppRequestPayload struct {
	PageName string `json:"pageName"`
}

type InvokeMethodPayload

type InvokeMethodPayload struct {
	MethodID   string            `json:"methodId"`
	MethodName string            `json:"methodName"`
	ControlID  string            `json:"controlId"`
	Arguments  map[string]string `json:"arguments"`
}

type Message

type Message struct {
	ID      string          `json:"id"`
	Action  string          `json:"action"`
	Payload json.RawMessage `json:"payload"`
}

func NewMessage

func NewMessage(id string, action string, payload interface{}) *Message

type PageCommandRequestPayload

type PageCommandRequestPayload struct {
	PageName  string         `json:"pageName"`
	SessionID string         `json:"sessionID"`
	Command   *model.Command `json:"command"`
}

type PageCommandResponsePayload

type PageCommandResponsePayload struct {
	Result string `json:"result"`
	Error  string `json:"error"`
}

type PageCommandsBatchRequestPayload

type PageCommandsBatchRequestPayload struct {
	PageName  string           `json:"pageName"`
	SessionID string           `json:"sessionID"`
	Commands  []*model.Command `json:"commands"`
}

type PageCommandsBatchResponsePayload

type PageCommandsBatchResponsePayload struct {
	Results []string `json:"results"`
	Error   string   `json:"error"`
}

type PageEventPayload

type PageEventPayload struct {
	PageName    string `json:"pageName"`
	SessionID   string `json:"sessionID"`
	EventTarget string `json:"eventTarget"`
	EventName   string `json:"eventName"`
	EventData   string `json:"eventData"`
}

type RegisterHostClientRequestPayload

type RegisterHostClientRequestPayload struct {
	HostClientID string `json:"hostClientID"`
	PageName     string `json:"pageName"`
	AssetsDir    string `json:"assetsDir"`
	AuthToken    string `json:"authToken"`
	Permissions  string `json:"permissions"`
}

type RegisterHostClientResponsePayload

type RegisterHostClientResponsePayload struct {
	HostClientID string `json:"hostClientID"`
	SessionID    string `json:"sessionID"`
	PageName     string `json:"pageName"`
	Error        string `json:"error"`
}

type RegisterWebClientRequestPayload

type RegisterWebClientRequestPayload struct {
	PageName           string `json:"pageName"`
	PageRoute          string `json:"pageRoute"`
	PageWidth          string `json:"pageWidth"`
	PageHeight         string `json:"pageHeight"`
	WindowWidth        string `json:"windowWidth"`
	WindowHeight       string `json:"windowHeight"`
	WindowTop          string `json:"windowTop"`
	WindowLeft         string `json:"windowLeft"`
	IsPWA              string `json:"isPWA"`
	IsWeb              string `json:"isWeb"`
	IsDebug            string `json:"isDebug"`
	Platform           string `json:"platform"`
	PlatformBrightness string `json:"platformBrightness"`
	Media              string `json:"media"`
	SessionID          string `json:"sessionID"`
}

type RegisterWebClientResponsePayload

type RegisterWebClientResponsePayload struct {
	Session     *SessionPayload `json:"session"`
	AppInactive bool            `json:"appInactive"`
	Error       string          `json:"error"`
}

type RemoveControlPayload

type RemoveControlPayload struct {
	IDs []string `json:"ids"`
}

type ReplacePageControlsPayload

type ReplacePageControlsPayload struct {
	IDs      []string         `json:"ids"`
	Remove   bool             `json:"remove"`
	Controls []*model.Control `json:"controls"`
}

type SessionCrashedPayload

type SessionCrashedPayload struct {
	Message string `json:"message"`
}

type SessionCreatedPayload

type SessionCreatedPayload struct {
	PageName  string `json:"pageName"`
	SessionID string `json:"sessionID"`
}

type SessionPayload

type SessionPayload struct {
	ID       string                    `json:"id"`
	Controls map[string]*model.Control `json:"controls"`
}

type UpdateControlPropsPayload

type UpdateControlPropsPayload struct {
	Props []map[string]string `json:"props"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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