lark

package
v0.0.0-...-e86f03a Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2023 License: MIT Imports: 13 Imported by: 0

README

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewNotifier

func NewNotifier(opts ...Option) notifier.Notifier

Types

type Content

type Content struct {
	Text string `json:"text"`
}

type Message

type Message interface {
	Body() map[string]interface{}
}

Message interface

type MsgType

type MsgType string
const (
	MsgTypeText        MsgType = "text"
	MsgTypePost        MsgType = "post"
	MsgTypeImage       MsgType = "image"
	MsgTypeShareChat   MsgType = "share_chat"
	MsgTypeInteractive MsgType = "interactive"
)

MsgType

type Notifier

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

Notifier 飞书客户端

func (*Notifier) Send

func (c *Notifier) Send(_ context.Context, _, content string) error

Send 发送聊天消息

type Option

type Option func(o *Notifier)

func AccessToken

func AccessToken(token string) Option

AccessToken 飞书访问令牌

func Logger

func Logger(logger notifier.Logger) Option

Logger 日志记录器

func Secret

func Secret(secret string) Option

Secret 飞书签名密钥

type TextMessage

type TextMessage struct {
	MsgType MsgType `json:"msg_type"`
	Content Content `json:"content"`
}

func (*TextMessage) Body

func (m *TextMessage) Body() map[string]interface{}

Jump to

Keyboard shortcuts

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