Documentation ¶
Overview ¶
Package matrix provides message notification integration for Matrix.
Usage:
package main import ( "log" "github.com/nikoksr/notify" "github.com/nikoksr/notify/service/matrix" ) func main() { matrixSvc, err := matrix.New("fake-user-id", "fake-room-id", "fake-home-server", "fake-access-token") if err != nil { log.Fatalf("matrix.New() failed: %s", err.Error()) } notifier := notify.New() notifier.UseServices(matrixSvc) err = notifier.Send(context.Background(), "subject", "message") if err != nil { log.Fatalf("notifier.Send() failed: %s", err.Error()) } log.Println("notification sent") }
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Matrix ¶
type Matrix struct {
// contains filtered or unexported fields
}
Matrix struct that holds necessary data to communicate with the Matrix API.
type Message ¶
type Message struct { Body string `json:"body"` Format string `json:"format,omitempty"` FormattedBody string `json:"formatted_body,omitempty"` Msgtype event.MessageType `json:"msgtype"` }
Message structure that reassembles the SendMessageEvent.
type ServiceOptions ¶
type ServiceOptions struct {
// contains filtered or unexported fields
}
ServiceOptions allow you to configure the Matrix client options.
Click to show internal directories.
Click to hide internal directories.