Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RocketChat ¶
type RocketChat struct {
// contains filtered or unexported fields
}
RocketChat struct holds necessary data to communicate with the RocketChat API.
func New ¶
func New(serverURL, scheme, userID, token string) (*RocketChat, error)
New returns a new instance of a RocketChat notification service. serverURL is the endpoint of server i.e "localhost" , scheme is protocol i.e "http/https" userID and token of the user sending the message.
func (*RocketChat) AddReceivers ¶
func (r *RocketChat) AddReceivers(channelNames ...string)
AddReceivers takes rocketchat channel names and adds them to the internal channel list. The Send method will send a given message to all channels in the list.
func (*RocketChat) Send ¶
func (r *RocketChat) Send(ctx context.Context, subject, message string) error
Send takes a message subject and a message body and sends them to all previously set channels. user used for sending the message has to be a member of the channel. https://docs.rocket.chat/api/rest-api/methods/chat/postmessage