ding

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ActionCard

type ActionCard struct {
	Title          string `json:"title"`
	Text           string `json:"text"`
	HideAvatar     string `json:"hideAvatar"`
	BtnOrientation string `json:"btnOrientation"`
	SingleTitle    string `json:"singleTitle"`
	SingleURL      string `json:"singleURL"`
}

ActionCard is ding talk msg sub struct

type Client

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

Client is ding talk notifier client

func NewClient

func NewClient(token string) *Client

NewClient construct a ding talk notifier client

func (*Client) Close

func (dc *Client) Close() error

func (*Client) GetName

func (dc *Client) GetName() string

func (*Client) Notify

func (dc *Client) Notify(ctx context.Context, msg *types.Message) error

Notify impl notifier's notify method

func (*Client) SetHTTPClient

func (dc *Client) SetHTTPClient(hc *http.Client)

SetHTTPClient can replace http client to yourself

func (*Client) SetLogger

func (dc *Client) SetLogger(logger log.Logger)

SetLogger can replace logger

type RequestMsg

type RequestMsg struct {
	Msgtype    string `json:"msgtype"`
	ActionCard `json:"actionCard"`
}

DingTalkMsg is ding talk msg struct

type Resp

type Resp struct {
	ErrMsg  string `json:"errmsg"`
	ErrCode int    `json:"errcode"`
}

DingTalkResp is ding talk resp struct

Jump to

Keyboard shortcuts

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