wecom

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2023 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	CorpID     string
	CorpSecret string
	AgentID    string

	Token          string
	RasPrivateKey  string
	EncodingAESKey string
	Cache          cache.Cache
}

Config is the Service configuration.

type Service

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

Service encapsulates the WeCom client along with internal state for storing users.

func New

func New(cfg *Config) *Service

New returns a new instance of a WeCom notification service.

func (*Service) AddPartyReceivers

func (s *Service) AddPartyReceivers(toParty ...string)

func (*Service) AddReceivers

func (s *Service) AddReceivers(toUser ...string)

AddReceivers takes user ids and adds them to the internal users list. The Send method will send a given message to all those users.

func (*Service) AddTagReceivers

func (s *Service) AddTagReceivers(toTag ...string)

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