Documentation
¶
Index ¶
- type AcceptSheetOp
- type AcceptSheetOpData
- type ChangesetReq
- type ChatBroadCastMessage
- type ChatMessage
- type ChatMessageData
- type ChatMessageSendData
- type ChatMessageSendEvent
- type ClientMessage
- type ClientMessageData
- type ClientMessageDataData
- type ClientMessagePayload
- type ClientReady
- type ClientReadyData
- type ClientReadyUserInfo
- type GetChatMessages
- type GetChatMessagesResponse
- type NewSheetOp
- type NewSheetOpData
- type Session
- type SessionAuth
- type SheetOpIncoming
- type SheetPresence
- type SheetPresenceData
- type SheetPresenceIncoming
- type SheetVars
- type SheetVarsData
- type UserChange
- type UserChangeData
- type UserChangeDataData
- type UserChangeDataDataApool
- type UserLeaveData
- type UserNewInfo
- type UserNewInfoDat
- type UserNewInfoData
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AcceptSheetOp ¶ added in v0.6.5
type AcceptSheetOp struct {
Type string `json:"type"` // "COLLABROOM"
Data AcceptSheetOpData `json:"data"`
}
AcceptSheetOp acknowledges the sender's own op. Sent as ["message", AcceptSheetOp].
type AcceptSheetOpData ¶ added in v0.6.5
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 ChatMessageSendEvent ¶ added in v0.0.2
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 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 GetChatMessages ¶ added in v0.0.2
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 NewSheetOp ¶ added in v0.6.5
type NewSheetOp struct {
Type string `json:"type"` // "COLLABROOM"
Data NewSheetOpData `json:"data"`
}
NewSheetOp broadcasts a rebased op to the other clients of a sheet. Sent as ["message", NewSheetOp].
type NewSheetOpData ¶ added in v0.6.5
type NewSheetOpData struct {
Type string `json:"type"` // "NEW_SHEET_OP"
Op json.RawMessage `json:"op"`
NewRev int `json:"newRev"`
Author string `json:"author"`
}
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 SheetOpIncoming ¶ added in v0.6.5
type SheetOpIncoming struct {
Event string `json:"event"`
Data struct {
Component string `json:"component"` // "sheet"
Type string `json:"type"` // "COLLABROOM"
Data struct {
Type string `json:"type"` // "SHEET_OP"
Op json.RawMessage `json:"op"` // a sheet.Op
BaseRev int `json:"baseRev"`
} `json:"data"`
} `json:"data"`
}
SheetOpIncoming is the client->server SHEET_OP message. Wire shape mirrors UserChange: {"event":"message","data":{"component":"sheet","type":"COLLABROOM", "data":{"type":"SHEET_OP","op":<sheet.Op>,"baseRev":N}}}.
type SheetPresence ¶ added in v0.6.5
type SheetPresence struct {
Type string `json:"type"` // "COLLABROOM"
Data SheetPresenceData `json:"data"`
}
SheetPresence is the server->clients relay of a cursor / live-edit frame. Sent as ["message", SheetPresence]. Identity is stamped server-side.
type SheetPresenceData ¶ added in v0.6.5
type SheetPresenceData struct {
Type string `json:"type"` // "SHEET_PRESENCE"
UserId string `json:"userId"`
Name string `json:"name"`
Color string `json:"color"`
Sheet string `json:"sheet"`
Row int `json:"row"`
Col int `json:"col"`
Editing bool `json:"editing"`
Raw string `json:"raw,omitempty"`
FocusRow int `json:"focusRow"`
FocusCol int `json:"focusCol"`
}
type SheetPresenceIncoming ¶ added in v0.6.5
type SheetPresenceIncoming struct {
Event string `json:"event"`
Data struct {
Component string `json:"component"` // "sheet"
Type string `json:"type"` // "COLLABROOM"
Data struct {
Type string `json:"type"` // "SHEET_PRESENCE"
Sheet string `json:"sheet"`
Row int `json:"row"`
Col int `json:"col"`
Editing bool `json:"editing"`
Raw string `json:"raw"`
FocusRow int `json:"focusRow"`
FocusCol int `json:"focusCol"`
} `json:"data"`
} `json:"data"`
}
SheetPresenceIncoming is the client->server SHEET_PRESENCE frame. Ephemeral: never persisted, never ordered through the per-doc goroutine. Wire shape mirrors SheetOpIncoming: {"event":"message","data":{"component":"sheet", "type":"COLLABROOM","data":{"type":"SHEET_PRESENCE","sheet":..,"row":.., "col":..,"editing":bool,"raw":".."}}}.
type SheetVars ¶ added in v0.6.5
type SheetVars struct {
Type string `json:"type"` // "SHEET_VARS"
Data SheetVarsData `json:"data"`
}
SheetVars is the server->client initial state message (the sheet analogue of CLIENT_VARS). Sent as ["message", SheetVars].
type SheetVarsData ¶ added in v0.6.5
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 UserLeaveData ¶ added in v0.0.2
type UserNewInfo ¶
type UserNewInfo struct {
Type string `json:"type"`
Data UserNewInfoData `json:"data"`
}
type UserNewInfoDat ¶
type UserNewInfoData ¶
type UserNewInfoData struct {
Type string `json:"type"`
UserInfo UserNewInfoDat `json:"userInfo"`
}