wecom

package
Version: v0.0.0-...-2443ee7 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2021 License: MIT Imports: 2 Imported by: 0

README

wecom

A simple WeCom Robot sender with default markdown type

Usage

res, err := wecom.Send("webhook", "hi")
if err != nil {
    logrus.Error(err)
}
logrus.Info(string(res))

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Send

func Send(webhook, content string) ([]byte, error)

Send sends the content

Types

type Message

type Message struct {
	MsgType  string          `json:"msgtype"`
	Markdown MessageMarkdown `json:"markdown"`
}

Message to be sent by robot

type MessageMarkdown

type MessageMarkdown struct {
	Content string `json:"content"`
}

MessageMarkdown markdown content

type Robot

type Robot interface{}

Robot interface

func NewWeComRobot

func NewWeComRobot(webhook string) (r Robot)

NewWeComRobot factory

type WCRobot

type WCRobot struct {
	Webhook string
}

WCRobot WeComRobot

func (*WCRobot) Send

func (w *WCRobot) Send(content string) ([]byte, error)

Send sends the content

Jump to

Keyboard shortcuts

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