mxadmin

package
v0.0.0-...-560a5fa Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AdminClient

type AdminClient struct {
	*mautrix.Client
}

func NewAdminClient

func NewAdminClient(homeserverURL string, userID id.UserID, accessToken string) (*AdminClient, error)

NewClient creates a new Matrix Client ready for syncing

func (*AdminClient) BuildAdminURL

func (cli *AdminClient) BuildAdminURL(urlPath ...interface{}) string

BuildAdminURL builds a URL with the Client's homeserver and appservice user ID set already. This method also automatically prepends the synapse API prefix (/_synapse/admin).

func (*AdminClient) ListRooms

func (cli *AdminClient) ListRooms(from int, limit int) (resp *RespRoomList, err error)

func (*AdminClient) RoomDetail

func (cli *AdminClient) RoomDetail(room_id id.RoomID) (resp *RespRoomDetail, err error)

func (*AdminClient) RoomForwardExtremities

func (cli *AdminClient) RoomForwardExtremities(room_id id.RoomID) (resp *RespRoomForwardExtremities, err error)

func (*AdminClient) RoomMembers

func (cli *AdminClient) RoomMembers(room_id id.RoomID) (resp *RespRoomMembers, err error)

type AdminURLPath

type AdminURLPath []interface{}

func (AdminURLPath) FullPath

func (cup AdminURLPath) FullPath() []interface{}

type RespRoomDetail

type RespRoomDetail struct {
	RoomID               id.RoomID `json:"room_id"`
	Name                 string    `json:"name"`
	Avatar               string    `json:"avatar"`
	Topic                string    `json:"topic"`
	CanonicalAlias       string    `json:"canoncial_alias"`
	Joined_members       int       `json:"joined_members"`
	Joined_local_members int       `json:"joined_local_members"`
	Joined_local_devices int       `json:"joined_local_devices"`
	Version              string    `json:"version"`
	Creator              string    `json:"creator"`
	Encryption           string    `json:"encryption"`
	Federatable          bool      `json:"federatable"`
	Public               bool      `json:"public"`
	Join_rules           string    `json:"join_rules"`
	Guest_access         string    `json:"guest_access"`
	History_visibility   string    `json:"history_visibility"`
	State_events         int       `json:"state_events"`
}

type RespRoomForwardExtremities

type RespRoomForwardExtremities struct {
	Count   int                              `json:"count"`
	Results []RespRoomForwardExtremityDetail `json:"results"`
}

type RespRoomForwardExtremityDetail

type RespRoomForwardExtremityDetail struct {
	EventID    string `json:"event_id"`
	StateGroup int64  `json:"state_group"`
	Depth      int64  `json:"depth"`
	ReceivedTS int64  `json:"received_ts"`
}

type RespRoomList

type RespRoomList struct {
	Rooms      []RespRoomDetail `json:"rooms"`
	Offset     int              `json:"offset"`
	TotalRooms int              `json:"total_rooms"`
	NextBatch  int              `json:"next_batch"`
	PrevBatch  int              `json:"prev_batch"`
}

type RespRoomMembers

type RespRoomMembers struct {
	Members []id.UserID `json:"members"`
	Total   int         `json:"total"`
}

Jump to

Keyboard shortcuts

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