status

package
v0.12.1 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2022 License: MPL-2.0 Imports: 10 Imported by: 18

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  int64            `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) Send added in v0.12.1

func (pong *BridgeState) Send(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 (
	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 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   int64                       `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"`
	ManualRetryCount int        `json:"manual_retry_count"`
}

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

type MessageCheckpointStatus

type MessageCheckpointStatus string
const (
	MsgStatusSuccess     MessageCheckpointStatus = "SUCCESS"
	MsgStatusWillRetry   MessageCheckpointStatus = "WILL_RETRY"
	MsgStatusPermFailure MessageCheckpointStatus = "PERM_FAILURE"
	MsgStatusUnsupported MessageCheckpointStatus = "UNSUPPORTED"
	MsgStatusTimeout     MessageCheckpointStatus = "TIMEOUT"
)

type MessageCheckpointStep

type MessageCheckpointStep string
const (
	MsgStepClient     MessageCheckpointStep = "CLIENT"
	MsgStepHomeserver MessageCheckpointStep = "HOMESERVER"
	MsgStepBridge     MessageCheckpointStep = "BRIDGE"
	MsgStepDecrypted  MessageCheckpointStep = "DECRYPTED"
	MsgStepRemote     MessageCheckpointStep = "REMOTE"
	MsgStepCommand    MessageCheckpointStep = "COMMAND"
)

Jump to

Keyboard shortcuts

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