Documentation ¶
Index ¶
- Variables
- type BridgeState
- type BridgeStateErrorCode
- type BridgeStateErrorMap
- type BridgeStateEvent
- type BridgeStateFiller
- type CheckpointsJSON
- type CustomBridgeStateFiller
- type GlobalBridgeState
- type MessageCheckpoint
- type MessageCheckpointReportedBy
- type MessageCheckpointStatus
- type MessageCheckpointStep
- type RemoteProfile
- type StandaloneCustomBridgeStateFiller
Constants ¶
This section is empty.
Variables ¶
View Source
var BridgeStateHumanErrors = make(BridgeStateErrorMap)
View Source
var CheckpointTypes = map[event.Type]struct{}{ event.EventRedaction: {}, event.EventMessage: {}, event.EventEncrypted: {}, event.EventSticker: {}, event.EventReaction: {}, }
Functions ¶
This section is empty.
Types ¶
type BridgeState ¶
type BridgeState struct { StateEvent BridgeStateEvent `json:"state_event"` Timestamp jsontime.Unix `json:"timestamp"` TTL int `json:"ttl"` Source string `json:"source,omitempty"` Error BridgeStateErrorCode `json:"error,omitempty"` Message string `json:"message,omitempty"` UserID id.UserID `json:"user_id,omitempty"` RemoteID string `json:"remote_id,omitempty"` RemoteName string `json:"remote_name,omitempty"` RemoteProfile *RemoteProfile `json:"remote_profile,omitempty"` Reason string `json:"reason,omitempty"` Info map[string]interface{} `json:"info,omitempty"` }
func (BridgeState) Fill ¶
func (pong BridgeState) Fill(user any) BridgeState
func (*BridgeState) SendHTTP ¶ added in v0.15.3
func (pong *BridgeState) SendHTTP(ctx context.Context, url, token string) error
func (*BridgeState) ShouldDeduplicate ¶
func (pong *BridgeState) ShouldDeduplicate(newPong *BridgeState) bool
type BridgeStateErrorCode ¶
type BridgeStateErrorCode string
type BridgeStateErrorMap ¶
type BridgeStateErrorMap map[BridgeStateErrorCode]string
func (BridgeStateErrorMap) Update ¶
func (bem BridgeStateErrorMap) Update(data BridgeStateErrorMap)
type BridgeStateEvent ¶
type BridgeStateEvent string
const ( StateStarting BridgeStateEvent = "STARTING" StateUnconfigured BridgeStateEvent = "UNCONFIGURED" StateRunning BridgeStateEvent = "RUNNING" StateBridgeUnreachable BridgeStateEvent = "BRIDGE_UNREACHABLE" StateConnecting BridgeStateEvent = "CONNECTING" StateBackfilling BridgeStateEvent = "BACKFILLING" StateConnected BridgeStateEvent = "CONNECTED" StateTransientDisconnect BridgeStateEvent = "TRANSIENT_DISCONNECT" StateBadCredentials BridgeStateEvent = "BAD_CREDENTIALS" StateUnknownError BridgeStateEvent = "UNKNOWN_ERROR" StateLoggedOut BridgeStateEvent = "LOGGED_OUT" )
type BridgeStateFiller ¶
type CheckpointsJSON ¶
type CheckpointsJSON struct {
Checkpoints []*MessageCheckpoint `json:"checkpoints"`
}
type CustomBridgeStateFiller ¶ added in v0.15.4
type CustomBridgeStateFiller interface { BridgeStateFiller StandaloneCustomBridgeStateFiller }
type GlobalBridgeState ¶
type GlobalBridgeState struct { RemoteStates map[string]BridgeState `json:"remoteState"` BridgeState BridgeState `json:"bridgeState"` }
type MessageCheckpoint ¶
type MessageCheckpoint struct { EventID id.EventID `json:"event_id"` RoomID id.RoomID `json:"room_id"` Step MessageCheckpointStep `json:"step"` Timestamp jsontime.UnixMilli `json:"timestamp"` Status MessageCheckpointStatus `json:"status"` EventType event.Type `json:"event_type"` ReportedBy MessageCheckpointReportedBy `json:"reported_by"` RetryNum int `json:"retry_num"` MessageType event.MessageType `json:"message_type,omitempty"` Info string `json:"info,omitempty"` ClientType string `json:"client_type,omitempty"` ClientVersion string `json:"client_version,omitempty"` OriginalEventID id.EventID `json:"original_event_id,omitempty"` ManualRetryCount int `json:"manual_retry_count,omitempty"` }
func NewMessageCheckpoint ¶
func NewMessageCheckpoint(evt *event.Event, step MessageCheckpointStep, status MessageCheckpointStatus, retryNum int) *MessageCheckpoint
type MessageCheckpointReportedBy ¶
type MessageCheckpointReportedBy string
const ( MsgReportedByAsmux MessageCheckpointReportedBy = "ASMUX" MsgReportedByBridge MessageCheckpointReportedBy = "BRIDGE" MsgReportedByHungry MessageCheckpointReportedBy = "HUNGRYSERV" )
func (MessageCheckpointReportedBy) IsValid ¶ added in v0.15.3
func (mcrb MessageCheckpointReportedBy) IsValid() bool
type MessageCheckpointStatus ¶
type MessageCheckpointStatus string
const ( MsgStatusSuccess MessageCheckpointStatus = "SUCCESS" MsgStatusWillRetry MessageCheckpointStatus = "WILL_RETRY" MsgStatusPermFailure MessageCheckpointStatus = "PERM_FAILURE" MsgStatusUnsupported MessageCheckpointStatus = "UNSUPPORTED" MsgStatusTimeout MessageCheckpointStatus = "TIMEOUT" MsgStatusDelivered MessageCheckpointStatus = "DELIVERED" MsgStatusDeliveryFailed MessageCheckpointStatus = "DELIVERY_FAILED" )
func ReasonToCheckpointStatus ¶
func ReasonToCheckpointStatus(reason event.MessageStatusReason, status event.MessageStatus) MessageCheckpointStatus
func (MessageCheckpointStatus) IsValid ¶ added in v0.15.3
func (mcs MessageCheckpointStatus) IsValid() bool
type MessageCheckpointStep ¶
type MessageCheckpointStep string
const ( MsgStepClient MessageCheckpointStep = "CLIENT" MsgStepHomeserver MessageCheckpointStep = "HOMESERVER" MsgStepBridge MessageCheckpointStep = "BRIDGE" MsgStepDecrypted MessageCheckpointStep = "DECRYPTED" MsgStepRemote MessageCheckpointStep = "REMOTE" MsgStepCommand MessageCheckpointStep = "COMMAND" )
func (MessageCheckpointStep) Before ¶ added in v0.15.0
func (mcs MessageCheckpointStep) Before(other MessageCheckpointStep) bool
func (MessageCheckpointStep) IsValid ¶ added in v0.15.3
func (mcs MessageCheckpointStep) IsValid() bool
type RemoteProfile ¶ added in v0.20.0
type RemoteProfile struct { Phone string `json:"phone,omitempty"` Email string `json:"email,omitempty"` Username string `json:"username,omitempty"` Name string `json:"name,omitempty"` Avatar id.ContentURIString `json:"avatar,omitempty"` }
func (*RemoteProfile) IsEmpty ¶ added in v0.20.0
func (rp *RemoteProfile) IsEmpty() bool
func (*RemoteProfile) Merge ¶ added in v0.20.0
func (rp *RemoteProfile) Merge(other RemoteProfile) RemoteProfile
type StandaloneCustomBridgeStateFiller ¶ added in v0.20.0
type StandaloneCustomBridgeStateFiller interface {
FillBridgeState(BridgeState) BridgeState
}
Click to show internal directories.
Click to hide internal directories.