matrix

package
v0.4.27 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

A simple SDK client for Matrix (ElementX). API documentation: https://spec.matrix.org/latest/client-server-api/

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(serverUrl string, optFns ...OptionsFunc) (*Client, error)

func (*Client) SendTextMessageToRoom

func (c *Client) SendTextMessageToRoom(ctx context.Context, roomId, msgBody string) error

SendText posts an m.room.message event (m.text). Отправляет текстовое сообщение в комнату (m.room.message, msgtype m.text). REF: https://spec.matrix.org/latest/client-server-api/#put_matrixclientv3roomsroomidsendeventtypetxnid

func (*Client) SetTLSConfig

func (c *Client) SetTLSConfig(config *tls.Config) *Client

func (*Client) SetTimeout

func (c *Client) SetTimeout(timeout time.Duration) *Client

type Options

type Options struct {
	UserId      string
	AccessToken string
}

type OptionsFunc

type OptionsFunc func(*Options)

func WithAccessToken

func WithAccessToken(accessToken string) OptionsFunc

func WithUserId

func WithUserId(userId string) OptionsFunc

Jump to

Keyboard shortcuts

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