dingding

package
v0.0.0-...-db4472a Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2024 License: MIT Imports: 3 Imported by: 0

README

dingtalk

Prerequisites

To use the service you need to apply for robot of DingTalk Group.

create robot of DingTalk group
  1. add custom rebot。
  2. look the safe setting, and select the sign(加签) Xnip2020-07-05_15-55-24.jpg

Usage

cfg := Config{
  token:  "dddd",
  secret: "xxx",
}

s := New(&cfg)
s.Send(context.Background(), "subject", "content")

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Token  string
	Secret string
}

Config is the Service configuration.

type Service

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

Service encapsulates the DingTalk client.

func New

func New(cfg *Config) *Service

New returns a new instance of a DingTalk notification service.

func (*Service) Send

func (s *Service) Send(ctx context.Context, subject, content string) error

Send takes a message subject and a message content and sends them to all previously set users.

Jump to

Keyboard shortcuts

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