feishu

package
v0.0.0-...-9970c52 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2026 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

type FeiShu

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

func (*FeiShu) CloseCli

func (receiver *FeiShu) CloseCli(alertChannelName string)

UpdateCli 如果 appid 和 appSecret 修改需要重新初始化客户端

func (*FeiShu) GetCli

func (receiver *FeiShu) GetCli(alertChannelName string) (*lark.Client, error)

func (*FeiShu) Init

func (receiver *FeiShu) Init(alertChannelName, appid, appSecret string)

func (*FeiShu) Notify

func (receiver *FeiShu) Notify(ctx context.Context, notifyReq *types.NotifyReq) (result *types.NotifySendResult, err error)

func (*FeiShu) UpdateCli

func (receiver *FeiShu) UpdateCli(alertChannelName, appid, appSecret string)

UpdateCli 如果 appid 和 appSecret 修改需要重新初始化客户端

type FeiShuContent

type FeiShuContent struct {
	Type string                `json:"type"`
	Data FeishuCardDataContent `json:"data"`
}

FeiShuContent 飞书卡片模版request

type FeishuCard

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

func SendCard

func SendCard(cli *lark.Client) *FeishuCard

func (*FeishuCard) Build

func (receiver *FeishuCard) Build(ctx context.Context, receiveIdType, receiveId, content string) error

type FeishuCardDataContent

type FeishuCardDataContent struct {
	TemplateId          string         `json:"template_id"  yaml:"template_id"`
	TemplateNersionName string         `json:"template_version_name" yaml:"template_version_name"`
	TemplateVariable    map[string]any `json:"template_variable" yaml:"template_variable"`
}

func RenderingAlertContent

func RenderingAlertContent() *FeishuCardDataContent

func (*FeishuCardDataContent) Build

func (receiver *FeishuCardDataContent) Build(ctx context.Context, alert any, alertTpl string) (*FeiShuContent, error)
type FeishuCardLink struct {
	PcUrl      string `yaml:"pc_url"`
	AndroidUrl string `yaml:"android_url"`
	IosUrl     string `yaml:"ios_url"`
	Url        string `yaml:"url"`
}

type Feishuer

type Feishuer interface {
	Init(alertChannelName, appid, appSecret string)
	GetCli(alertChannelName string) (*lark.Client, error)
	UpdateCli(alertChannelName, appid, appSecret string)
	CloseCli(alertChannelName string)
	Notifyer
}

func NewFeiShu

func NewFeiShu() Feishuer

type Notifyer

type Notifyer interface {
	Notify(ctx context.Context, notifyReq *types.NotifyReq) (result *types.NotifySendResult, err error)
}

Jump to

Keyboard shortcuts

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