status

package
v0.18.3 Latest Latest
Warning

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

Go to latest
Published: May 21, 2024 License: MPL-2.0 Imports: 14 Imported by: 0

Documentation

Index

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

	Reason string                 `json:"reason,omitempty"`
	Info   map[string]interface{} `json:"info,omitempty"`
}

func (BridgeState) Fill

func (pong BridgeState) Fill(user BridgeStateFiller) BridgeState

func (*BridgeState) SendHTTP

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 BridgeStateFiller interface {
	GetMXID() id.UserID
	GetRemoteID() string
	GetRemoteName() string
}

type CheckpointsJSON

type CheckpointsJSON struct {
	Checkpoints []*MessageCheckpoint `json:"checkpoints"`
}

func (*CheckpointsJSON) SendHTTP

func (cj *CheckpointsJSON) SendHTTP(endpoint string, token string) error

type CustomBridgeStateFiller

type CustomBridgeStateFiller interface {
	BridgeStateFiller
	FillBridgeState(BridgeState) BridgeState
}

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

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 (MessageCheckpointStatus) IsValid

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

func (MessageCheckpointStep) IsValid

func (mcs MessageCheckpointStep) IsValid() bool

Jump to

Keyboard shortcuts

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