goMatrix

package module
v0.0.0-...-f3d9861 Latest Latest
Warning

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

Go to latest
Published: May 31, 2016 License: MPL-2.0 Imports: 8 Imported by: 1

README

goMatrix

Build Status

A go library for Matrix. I've only implemented the functionality I needed for a project I’m working on.

Documentation can be found here https://godoc.org/github.com/geir54/goMatrix

Implemented
  • Read messages
  • Send messages
  • Get join notificaitons with room ID and name

Pull requests are more than welcome

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RoomInfo

type RoomInfo struct {
	Name string
}

RoomInfo - Information about a room

type RoomMessage

type RoomMessage struct {
	RoomID   string
	RoomName string
	Sender   string
	Text     string
}

RoomMessage - Message from a room

type Session

type Session struct {
	NextBatch   string
	Rooms       map[string]RoomInfo // The rooms a user is part of
	AccessToken string
	HomeServer  string
	OnNewMsg    chan RoomMessage
	OnJoin      chan string // When we find a new room
	TxnID       int
	// contains filtered or unexported fields
}

Session .

func Init

func Init(homeserver string) *Session

Init .

func (*Session) Close

func (session *Session) Close()

Close closes everything down

func (*Session) Login

func (session *Session) Login(user, password string) error

Login .

func (*Session) RoomNameToID

func (session *Session) RoomNameToID(roomName string) string

RoomNameToID - get the room id from a room name

func (*Session) SendToRoom

func (session *Session) SendToRoom(room, message string) error

SendToRoom - Send message to room

func (*Session) Start

func (session *Session) Start()

Start ..

func (*Session) Sync

func (session *Session) Sync() error

Sync .

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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