types

package
v0.0.0-...-9835270 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2021 License: AGPL-3.0, Apache-2.0, MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	//proxy -> front
	PUSH_API_GROUP       = "pushapi"
	ENCRY_API_GROUP      = "encryptoapi"
	CLIENT_API_GROUP     = "clientapi"
	PUBLICROOM_API_GROUP = "publicroomapi"
	RCSSERVER_API_GROUP  = "rcsserverapi"

	//other server -> front
	PROFILE_RPC_GROUP    = "profilerpc"
	PUBLICROOM_RPC_GROUP = "publicroomrpc"
	RCSSERVER_RPC_GROUP  = "rcsserverrpc"
	ROOMINPUT_RPC_GROUP  = "roominputrpc"
	ROOOMALIAS_RPC_GROUP = "roomaliasrpc"
	ROOMQRY_PRC_GROUP    = "roomqryrpc"
)
View Source
const (
	LOCK_INSTANCE_PREFIX      = "dist_lock_instance:"
	LOCK_ROOMSTATE_PREFIX     = "dist_lock_roomstate:"
	LOCK_ROOMSTATE_EXT_PREFIX = "dist_lock_roomstate_ext:"
)

dist_lock prefix

View Source
const (
	DEVICEKEYUPDATE  = "DeviceKeyUpdate"
	ONETIMEKEYUPDATE = "OneTimeKeyUpdate"
)
View Source
const (
	FILTERTOKENADD = "FilterTokenAdd"
	FILTERTOKENDEL = "FilterTokenDel"
)
View Source
const (
	DB_EXCEED_TIME         = 1000
	CHECK_LOAD_EXCEED_TIME = 5000
)
View Source
const (
	BODYDEVICEKEY = iota
	BODYONETIMEKEY
	ONETIMEKEYSTRING
	ONETIMEKEYOBJECT
)

Variables

View Source
var DeviceStateUpdateDef = "sync-device-state-update-topic"
View Source
var EduTopicDef = "fed-edu-topic"
View Source
var EventTopicDef = "sync-event-topic"
View Source
var EventUpdateTopicDef = "sync-event-update-topic"
View Source
var FilterTokenTopicDef = "filter-token-topic"
View Source
var JoinedRoomTopicDef = "sync-joined-room-topic"
View Source
var KcTopicDef = "sync-kc-topic"
View Source
var KeyUpdateTopicDef = "sync-key-update-topic"
View Source
var LoginTopicDef = "login-info-topic"
View Source
var PresenceTopicDef = "sync-presence-topic"
View Source
var ProfileUpdateTopicDef = "fed-profile-update-topic"
View Source
var RCSEventTopicDef = "rcs-event-topic"
View Source
var ReceiptTopicDef = "sync-receipt-topic"
View Source
var ReceiptUpdateTopicDef = "sync-receipt-update-topic"
View Source
var StdTopicDef = "sync-std-topic"
View Source
var SyncServerTopicDef = "sync-server-topic"
View Source
var SyncTopicDef = "sync-sync-topic"
View Source
var SyncUnreadTopicDef = "sync-server-unread-topic"
View Source
var TypingTopicDef = "sync-typing-topic"
View Source
var TypingUpdateTopicDef = "sync-typing-update-topic"
View Source
var UnreadReqTopicDef = "sync-unread-req-topic"
View Source
var VerifyTokenTopicDef = "proxy-verify-token-topic"

Functions

This section is empty.

Types

type ActDataStreamUpdate

type ActDataStreamUpdate struct {
	UserID     string `json:"user_id"`
	RoomID     string `json:"room_id"`
	DataType   string `json:"data_type"`
	StreamType string `json:"stream_type"`
}

type AlHolder

type AlHolder struct {
	UserID,
	DeviceID,
	SupportedAlgorithm string
}

AlHolder structure

type Annotation

type Annotation struct {
	Type  string `json:"type"`
	Key   string `json:"key"`
	Count int    `json:"count"`
}

type Annotations

type Annotations struct {
	Chunk []*Annotation `json:"chunk"`
}

type CompressContent

type CompressContent struct {
	Content    []byte `json:"content"`
	Compressed bool   `json:"compressed"`
}

type DeviceKeyChanges

type DeviceKeyChanges struct {
	Offset        int64  `json:"off_set"`
	ChangedUserID string `json:"device_key_change_user"`
}

type DeviceKeys

type DeviceKeys struct {
	UserID    string                       `json:"user_id"`
	DeviceID  string                       `json:"device_id"`
	Algorithm []string                     `json:"algorithms"`
	Keys      map[string]string            `json:"keys"`
	Signature map[string]map[string]string `json:"signatures"`
}

DeviceKeys structure

type DeviceState

type DeviceState struct {
	UserID   string `json:"user_id,omitempty"`
	DeviceID string `json:"device_id,omitempty"`
	State    int    `json:"state,omitempty"`
}

type EventContent

type EventContent struct {
	EventID string `json:"event_id,omitempty"`
	UserID  string `json:"user_id,omitempty"`
	Reply   string
}

type EventRelations

type EventRelations struct {
	RelayTo *OriginInRelayTo `json:"m.in_reply_to,omitempty"`
	Anno    *Annotations     `json:"m.annotation,omitempty"`
}

type FilterTokenContent

type FilterTokenContent struct {
	UserID     string `json:"user_id,omitempty"`
	DeviceID   string `json:"device_id,omitempty"`
	FilterType string `json:"filter_type,omitempty"`
}

type HttpReq

type HttpReq struct {
	TimeOut     string `json:"time_out,omitempty"`
	FullState   string `json:"full_state,omitempty"`
	SetPresence string `json:"set_presence,omitempty"`
	Filter      string `json:"filter,omitempty"`
	From        string `json:"from,omitempty"`
	Since       string `json:"since,omitempty"`
	Limit       string `json:"limit,omitempty"`
	Dir         string `json:"dir,omitempty"`
	TraceId     string `json:"trace_id,omitempty"`
}

type InRelayTo

type InRelayTo struct {
	Sender         string      `json:"sender"`
	EventID        string      `json:"event_id"`
	Content        interface{} `json:"content"`
	OriginServerTs int64       `json:"origin_server_ts"`
}

type JoinedRoomContent

type JoinedRoomContent struct {
	UserID string `json:"user_id,omitempty"`
	Reply  string
}

type KeyChangeContent

type KeyChangeContent struct {
	FromPos int64  `json:"from_pos,omitempty"`
	ToPos   int64  `json:"to_pos,omitempty"`
	UserID  string `json:"user_id,omitempty"`
	Reply   string
}

type KeyChangeStream

type KeyChangeStream struct {
	ChangedUserID string
}

type KeyHolder

type KeyHolder struct {
	UserID,
	DeviceID,
	Signature,
	KeyAlgorithm,
	KeyID,
	Key,
	KeyType string
}

KeyHolder structure

type KeyObject

type KeyObject struct {
	Key       string                       `json:"key"`
	Signature map[string]map[string]string `json:"signatures"`
}

KeyObject structure

type KeyUpdateContent

type KeyUpdateContent struct {
	Type                     string             `json:"type"`
	OneTimeKeyChangeUserId   string             `json:"one_time_key_change_user"`
	OneTimeKeyChangeDeviceId string             `json:"one_time_key_change_device"`
	DeviceKeyChanges         []DeviceKeyChanges `json:"device_key_changes"`
	EventNID                 int64              `json:"event_id"`
	Reply                    string
}

type LoginInfoContent

type LoginInfoContent struct {
	UserID      string `json:"user_id,omitempty"`
	DeviceID    string `json:"device_id,omitempty"`
	Token       string `json:"token,omitempty"`
	DisplayName string `json:"display_name,omitempty"`
	Identifier  string `json:"identifier,omitempty"`
}

type MInRelayTo

type MInRelayTo struct {
	MRelayTo InRelayTo `json:"m.in_reply_to"`
}

type NotifyDeviceState

type NotifyDeviceState struct {
	UserID    string           `json:"user_id"`
	DeviceID  string           `json:"device_id"`
	Pushkeys  []PushKeyContent `json:"pushkeys"`
	LastState int              `json:"last_state"`
	CurState  int              `json:"cur_state"`
}

type NotifyUserState

type NotifyUserState struct {
	UserID    string `json:"user_id"`
	LastState int    `json:"last_state"`
	CurState  int    `json:"cur_state"`
}

type OneTimeKeySpecific

type OneTimeKeySpecific struct {
	KeyString map[string]string
	KeyObject map[string]KeyObject
}

OneTimeKeySpecific structure

type OnlinePresence

type OnlinePresence struct {
	Reply        string `json:"reply,omitempty"`
	UserID       string `json:"user_id"`
	Found        bool   `json:"found"`
	Presence     string `json:"presence,omitempty"`
	StatusMsg    string `json:"status_msg,omitempty"`
	ExtStatusMsg string `json:"ext_status_msg,omitempty"`
}

type OriginInRelayTo

type OriginInRelayTo struct {
	Chunk []string `json:"chunk"`
}

type PresenceJSON

type PresenceJSON struct {
	AvatarURL       string `json:"avatar_url"`
	DisplayName     string `json:"displayname"`
	LastActiveAgo   int64  `json:"last_active_ago"`
	Presence        string `json:"presence"` //required
	CurrentlyActive bool   `json:"currently_active"`
	UserID          string `json:"user_id"` //required
	StatusMsg       string `json:"status_msg"`
	ExtStatusMsg    string `json:"ext_status_msg"`

	UserName  string `json:"user_name"`
	JobNumber string `json:"job_number"`
	Mobile    string `json:"mobile"`
	Landline  string `json:"landline"`
	Email     string `json:"email"`
	State     int    `json:"state"`

	LastPresence     string `json:"last_presence"`
	LastStatusMsg    string `json:"last_status_msg"`
	LastExtStatusMsg string `json:"last_ext_status_msg"`
}

presence types

type PresenceShowJSON

type PresenceShowJSON struct {
	AvatarURL       string `json:"avatar_url"`
	DisplayName     string `json:"displayname"`
	LastActiveAgo   int64  `json:"last_active_ago"`
	Presence        string `json:"presence"` //required
	CurrentlyActive bool   `json:"currently_active"`
	UserID          string `json:"user_id"` //required
	StatusMsg       string `json:"status_msg"`
	ExtStatusMsg    string `json:"ext_status_msg"`
}

type PresenceStream

type PresenceStream struct {
	UserID  string
	Content []byte
}

type ProfileContent

type ProfileContent struct {
	UserID       string `json:"user_id,omitempty"`
	DisplayName  string `json:"display_name,omitempty"`
	AvatarUrl    string `json:"avatar_url,omitempty"`
	Presence     string `json:"presence,omitempty"`
	StatusMsg    string `json:"status_msg,omitempty"`
	ExtStatusMsg string `json:"ext_status_msg,omitempty"`

	// ext user_info
	UserName  string `json:"user_name,omitempty"`
	JobNumber string `json:"job_number,omitempty"`
	Mobile    string `json:"mobile,omitempty"`
	Landline  string `json:"landline,omitempty"`
	Email     string `json:"email,omitempty"`
	State     int    `json:"state,omitempty"`
}

type ProfileStreamUpdate

type ProfileStreamUpdate struct {
	UserID       string       `json:"user_id"`
	DeviceID     string       `json:"device_id"`
	Presence     PresenceJSON `json:"presence"`
	IsUpdateBase bool         `json:"is_update_base"` //matrix /presence/{userID}/status only update presence, status_msg, ext_status_msg
}

type PushKeyContent

type PushKeyContent struct {
	AppID   string `json:"app_id"`
	PushKey string `json:"pushkey"`
}

type RCSFriendship

type RCSFriendship struct {
	ID               string `json:"_id"`
	RoomID           string `json:"room_id"`
	FcID             string `json:"fcid"`
	ToFcID           string `json:"to_fcid"`
	FcIDState        string `json:"fcid_state"`
	ToFcIDState      string `json:"to_fcid_state"`
	FcIDIsBot        bool   `json:"fcid_is_bot"`
	ToFcIDIsBot      bool   `json:"to_fcid_is_bot"`
	FcIDRemark       string `json:"fcid_remark"`
	ToFcIDRemark     string `json:"to_fcid_remark"`
	FcIDOnceJoined   bool   `json:"fcid_once_joined"`
	ToFcIDOnceJoined bool   `json:"to_fcid_once_joined"`
	FcIDDomain       string `json:"fcid_domain"`
	ToFcIDDomain     string `json:"to_fcid_domain"`
	EventID          string `json:"event_id"`
}

type RCSInputEventContent

type RCSInputEventContent struct {
	Event gomatrixserverlib.Event
	Reply string `json:"reply"`
}

type RCSOutputEventContent

type RCSOutputEventContent struct {
	Events  []gomatrixserverlib.Event `json:"events"`
	Succeed bool                      `json:"succeed"`
}

type ReactionContent

type ReactionContent struct {
	EventID string `json:"event_id"`
	Key     string `json:"key"`
	RelType string `json:"rel_type"`
}

emoji message relay

type ReceiptContent

type ReceiptContent struct {
	UserID      string `json:"user_id,omitempty"`
	DeviceID    string `json:"device_id,omitempty"`
	RoomID      string `json:"room_id,omitempty"`
	ReceiptType string `json:"receipt_type,omitempty"`
	EventID     string `json:"event_id,omitempty"`
	Source      string `json:"source,omitemty"`
}

type ReceiptStream

type ReceiptStream struct {
	RoomID        string `json:"room_id"`
	Content       []byte `json:"content"`
	ReceiptOffset int64  `json:"offset"`
}

type RedactUnsigned

type RedactUnsigned struct {
	Age             int64                          `json:"age,omitempty"`
	PrevContent     []byte                         `json:"prev_content,omitempty"`
	TransactionID   string                         `json:"transaction_id,omitempty"`
	RedactedBecause *gomatrixserverlib.ClientEvent `json:"redacted_because,omitempty"`
	UpdatedBecause  *gomatrixserverlib.ClientEvent `json:"updated_because,omitempty"`
	IsRelated       *bool                          `json:"is_related,omitempty"`
}

type RoomInitSyncContent

type RoomInitSyncContent struct {
	UserID string `json:"user_id,omitempty"`
	RoomID string `json:"room_id,omitempty"`
	Reply  string
}

func (*RoomInitSyncContent) Decode

func (p *RoomInitSyncContent) Decode(input []byte) error

func (*RoomInitSyncContent) Encode

func (p *RoomInitSyncContent) Encode() ([]byte, error)

type RoomMemberContent

type RoomMemberContent struct {
	UserID string `json:"user_id,omitempty"`
	RoomID string `json:"room_id,omitempty"`
	Reply  string
}

type RoomMsgContent

type RoomMsgContent struct {
	Request HttpReq `json:"request,omitempty"`
	UserID  string  `json:"user_id,omitempty"`
	RoomID  string  `json:"room_id,omitempty"`
	Reply   string
}

type RoomStateByTypeContent

type RoomStateByTypeContent struct {
	RoomID   string `json:"room_id,omitempty"`
	EvType   string `json:"ev_type,omitempty"`
	StateKey string `json:"state_key,omitempty"`
	Reply    string
}

type RoomStateContent

type RoomStateContent struct {
	UserID string `json:"user_id,omitempty"`
	RoomID string `json:"room_id,omitempty"`
	Reply  string
}

type RoomStateExt

type RoomStateExt struct {
	PreStateId  string `json:"pre_state_id"`
	LastStateId string `json:"last_state_id"`
	PreMsgId    string `json:"pre_msg_id"`
	LastMsgId   string `json:"last_msg_id"`
	Depth       int64  `json:"depth"`
	HasUpdate   bool   `json:"has_update"`
	//must consistent with depth, db not has
	OutEventOffset int64 `json:"out_event_offset"`
	//domain:offset
	Domains map[string]int64 `json:"domains"`
}

type StdContent

type StdContent struct {
	StdRequest StdRequest `json:"std_request,omitempty"`
	Sender     string     `json:"sender,omitempty"`
	EventType  string     `json:"event_type,omitempty"`
	Reply      string
}

type StdEvent

type StdEvent struct {
	Sender  string      `json:"sender"`
	Type    string      `json:"type"`
	Content interface{} `json:"content"`
}

type StdRequest

type StdRequest struct {
	Sender map[string]map[string]interface{} `json:"messages"`
}

type SyncContent

type SyncContent struct {
	Request HttpReq          `json:"request,omitempty"`
	Device  authtypes.Device `json:"device,omitempty"`
	Reply   string           `json:"omitempty"`
}

type SysManageContent

type SysManageContent struct {
	Type  string `json:"type,omitempty"`
	Reply string
}

type TypingContent

type TypingContent struct {
	Type   string `json:"type,omitempty"`
	RoomID string `json:"room_id,omitempty"`
	UserID string `json:"user_id,omitempty"`
}

type UnreadReqContent

type UnreadReqContent struct {
	UserID string `json:"user_id,omitempty"`
	Reply  string
}

type Unsigned

type Unsigned struct {
	TransactionID string          `json:"transaction_id,omitempty"`
	Relations     *EventRelations `json:"m.relations,omitempty"`
}

type UploadEncrypt

type UploadEncrypt struct {
	DeviceKeys DeviceKeys             `json:"device_keys"`
	OneTimeKey map[string]interface{} `json:"one_time_keys"`
}

UploadEncrypt structure

func (*UploadEncrypt) Decode

func (r *UploadEncrypt) Decode(input []byte) error

func (*UploadEncrypt) Encode

func (r *UploadEncrypt) Encode() ([]byte, error)

type UploadEncryptSpecific

type UploadEncryptSpecific struct {
	DeviceKeys DeviceKeys         `json:"device_keys"`
	OneTimeKey OneTimeKeySpecific `json:"one_time_keys"`
}

UploadEncryptSpecific structure

type UserReceipt

type UserReceipt struct {
	UserID    string
	RoomID    string
	EvtOffset int64
	Content   []byte
	Written   bool
}

type VerifyTokenRequest

type VerifyTokenRequest struct {
	Token      string `json:"device"`
	RequestURI string `json:"request_uri"`
}

type VerifyTokenResponse

type VerifyTokenResponse struct {
	Device authtypes.Device `json:"device"`
	Error  string           `json:"error"`
}

type VisibilityRangeContent

type VisibilityRangeContent struct {
	RoomID string `json:"room_id,omitempty"`
	UserID string `json:"user_id,omitempty"`
	Reply  string
}

Jump to

Keyboard shortcuts

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