page

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2022 License: Apache-2.0 Imports: 19 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"

	InactiveAppFromHostAction = "inactiveAppFromHost"

	// 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"

	AppBecomeInactiveAction = "appBecomeInactive"

	SessionCrashedAction = "sessionCrashed"

	SignoutAction = "signout"
)
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 NewMessageData added in v0.3.0

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

func RunBackgroundTasks added in v0.1.12

func RunBackgroundTasks(ctx context.Context)

Types

type AddPageControlsPayload

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

type AppBecomeInactivePayload added in v0.3.0

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

type AppendControlPropsPayload added in v0.1.9

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, principal *auth.SecurityPrincipal) *Client

type ClientRole

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

type InactiveAppRequestPayload added in v0.3.0

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

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   *command.Command `json:"command"`
}

type PageCommandResponsePayload

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

type PageCommandsBatchRequestPayload added in v0.3.0

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

type PageCommandsBatchResponsePayload added in v0.3.0

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"`
	IsApp        bool   `json:"isApp"`
	Update       bool   `json:"update"`
	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"`
	PageHash  string `json:"pageHash"`
	WinWidth  string `json:"winWidth"`
	WinHeight string `json:"winHeight"`
	SessionID string `json:"sessionID"`
}

type RegisterWebClientResponsePayload

type RegisterWebClientResponsePayload struct {
	Session       *SessionPayload     `json:"session"`
	Error         string              `json:"error"`
	SigninOptions *auth.SigninOptions `json:"signinOptions"`
}

type RemoveControlPayload

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

type ReplacePageControlsPayload added in v0.2.0

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

type SessionCrashedPayload added in v0.3.1

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

type SessionCreatedPayload

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

type SessionPayload added in v0.1.12

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

type SignoutPayload added in v0.4.0

type SignoutPayload struct {
}

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