ws

package
v0.6.3 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2026 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChangesetReq added in v0.0.2

type ChangesetReq struct {
	Event string `json:"event"`
	Data  struct {
		Component string `json:"component"`
		Type      string `json:"type"`
		PadId     string `json:"padId"`
		Token     string `json:"token"`
		Data      struct {
			Start       int `json:"start"`
			Granularity int `json:"granularity"`
			RequestID   int `json:"requestID"`
		} `json:"data"`
	} `json:"data"`
}

type ChatBroadCastMessage added in v0.0.2

type ChatBroadCastMessage struct {
	Type string `json:"type"`
	Data struct {
		Type    string               `json:"type"`
		Message ChatMessageSendEvent `json:"message"`
	} `json:"data"`
}

type ChatMessage added in v0.0.2

type ChatMessage struct {
	Event string `json:"event"`
	Data  struct {
		Type      string `json:"type"`
		Component string `json:"component"`
		Data      struct {
			Type    string          `json:"type"`
			Message ChatMessageData `json:"message"`
		}
	}
}

type ChatMessageData added in v0.0.2

type ChatMessageData struct {
	Text        string  `json:"text"`
	Time        *int64  `json:"time,omitempty"`
	UserId      *string `json:"userId,omitempty"`
	AuthorId    *string `json:"authorId,omitempty"`
	DisplayName *string `json:"displayName,omitempty"`
	UserName    *string `json:"userName,omitempty"`
}

func FromObject added in v0.0.2

func FromObject(original ChatMessageData) ChatMessageData

type ChatMessageSendData added in v0.0.2

type ChatMessageSendData struct {
	Text     string  `json:"text"`
	Time     *int64  `json:"time,omitempty"`
	UserId   *string `json:"userId,omitempty"`
	UserName *string `json:"userName,omitempty"`
}

type ChatMessageSendEvent added in v0.0.2

type ChatMessageSendEvent struct {
	Text     string  `json:"text"`
	Time     *int64  `json:"time,omitempty"`
	UserId   *string `json:"userId,omitempty"`
	UserName *string `json:"userName"`
}

type ClientMessage added in v0.6.3

type ClientMessage struct {
	Event string            `json:"event"`
	Data  ClientMessageData `json:"data"`
}

ClientMessage is the COLLABROOM CLIENT_MESSAGE family from the original protocol. The payload type selects the sub-message: "suggestUserName" relays a name suggestion to an unnamed user, "padoptions" distributes pad-wide settings.

type ClientMessageData added in v0.6.3

type ClientMessageData struct {
	Component string                `json:"component"`
	Type      string                `json:"type"`
	Data      ClientMessageDataData `json:"data"`
}

type ClientMessageDataData added in v0.6.3

type ClientMessageDataData struct {
	Type    string               `json:"type"`
	Payload ClientMessagePayload `json:"payload"`
}

type ClientMessagePayload added in v0.6.3

type ClientMessagePayload struct {
	Type      string         `json:"type"`
	NewName   string         `json:"newName,omitempty"`
	UnnamedId string         `json:"unnamedId,omitempty"`
	Options   map[string]any `json:"options,omitempty"`
}

type ClientReady

type ClientReady struct {
	Event string          `json:"event"`
	Data  ClientReadyData `json:"data"`
}

type ClientReadyData added in v0.0.4

type ClientReadyData struct {
	Component string `json:"component"`
	Type      string `json:"type"`
	PadID     string `json:"padId"`
	Token     string `json:"token"`
	// SessionID is the deprecated legacy field for the integrator-set
	// sessionID cookie value, kept for backward compatibility with old
	// clients. Current clients no longer forward it; the server now reads
	// the cookie directly from the socket.io handshake so the cookie can
	// be marked HttpOnly. Upstream #7045 / #7755.
	SessionID string              `json:"sessionID,omitempty"`
	UserInfo  ClientReadyUserInfo `json:"userInfo"`
	Reconnect *bool               `json:"reconnect"`
	ClientRev *int                `json:"client_rev"`
}

type ClientReadyUserInfo added in v0.0.4

type ClientReadyUserInfo struct {
	ColorId *string `json:"colorId"`
	Name    *string `json:"name"`
}

type GetChatMessages added in v0.0.2

type GetChatMessages struct {
	Event string `json:"event"`
	Data  struct {
		Type      string `json:"type"`
		Component string `json:"component"`
		Data      struct {
			Type  string `json:"type"`
			Start int    `json:"start"`
			End   int    `json:"end"`
		} `json:"data"`
	}
}

type GetChatMessagesResponse added in v0.0.2

type GetChatMessagesResponse struct {
	Type string `json:"type"`
	Data struct {
		Type     string                `json:"type"`
		Messages []ChatMessageSendData `json:"messages"`
	} `json:"data"`
}

type Session

type Session struct {
	Author        string
	Auth          *SessionAuth
	Revision      int
	PadId         string
	ReadOnlyPadId string
	ReadOnly      bool
	Time          int64
}

type SessionAuth

type SessionAuth struct {
	PadId     string
	Token     string
	SessionId string
	// IntegratorSessionID is the integrator-set sessionID cookie value
	// (from createSession() HTTP API), read from the socket.io handshake
	// Cookie header so the cookie can be HttpOnly. Falls back to the
	// deprecated CLIENT_READY in-message `sessionID` field for legacy
	// clients. Upstream #7045 / #7755.
	IntegratorSessionID string
}

type UserChange

type UserChange struct {
	Event string         `json:"event"`
	Data  UserChangeData `json:"data"`
}

type UserChangeData added in v0.0.4

type UserChangeData struct {
	Component string             `json:"component"`
	Data      UserChangeDataData `json:"data"`
	Type      string             `json:"type"`
}

type UserChangeDataData added in v0.0.4

type UserChangeDataData struct {
	Type      string                  `json:"type"`
	Apool     UserChangeDataDataApool `json:"apool"`
	BaseRev   int                     `json:"baseRev"`
	Changeset string                  `json:"changeset"`
}

type UserChangeDataDataApool added in v0.0.4

type UserChangeDataDataApool struct {
	NumToAttrib map[int][]string `json:"numToAttrib"`
	NextNum     int              `json:"nextNum"`
}

type UserLeaveData added in v0.0.2

type UserLeaveData struct {
	Type string `json:"type"`
	Data struct {
		Type     string `json:"type"`
		UserInfo struct {
			ColorId string `json:"colorId"`
			UserId  string `json:"userId"`
		} `json:"userInfo"`
	} `json:"data"`
}

type UserNewInfo

type UserNewInfo struct {
	Type string          `json:"type"`
	Data UserNewInfoData `json:"data"`
}

type UserNewInfoDat

type UserNewInfoDat struct {
	UserId  string  `json:"userId"`
	Name    *string `json:"name"`
	ColorId string  `json:"colorId"`
}

type UserNewInfoData

type UserNewInfoData struct {
	Type     string         `json:"type"`
	UserInfo UserNewInfoDat `json:"userInfo"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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