lark

package module
v0.0.0-...-3f22163 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2021 License: MIT Imports: 4 Imported by: 2

README

lark

Lark (Feishu) plugin for goerrbit.

  1. Create app in https://open.feishu.cn/app and get the App ID and App Secret.

  2. You can send plain text message or rich text message. If you choose rich text message, you need to provide a JSON template. For details of the JSON object structure, see Lark Docs.

  3. Template uses Golang's text/template package. You can see default template for plain text message (DefaultTemplate) or rich text message (DefaultPostTemplate) in the lark.go file.

Currently, you can use these variables:

{{.Id}}
{{.AppId}}
{{.AppName}}
{{.Message}}
{{.ErrorClass}}
{{.Environment}}
{{.Location}}
{{.Url}}
{{.NoticesCount}}
{{.LastNoticeId}}
{{.LastNoticeAt}}
{{.FirstNoticeAt}}

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Name        = "lark"
	Description = `Send error messages to Lark. [README](https://github.com/caiguanhao/goerrbit/tree/master/plugins/lark)`

	DefaultTemplate = `{{.Message}}
{{.AppName}} ({{.Environment}})
{{.ErrorClass}} ({{.Location}})
{{.Url}}`
	DefaultPostTemplate = `` /* 1044-byte string literal not displayed */

)

Functions

func New

func New() interface{}

Types

type Lark

type Lark struct {
	AppId     string `validate:"required" label:"App ID" placeholder:"Lark App ID"`
	AppSecret string `validate:"required" type:"password" label:"App Secret" placeholder:"Lark App Secret"`
	Target    string `validate:"required" label:"Target" hint:"ID of a chat or user" placeholder:"Chat or user"`
	MsgType   msgtyp `validate:"oneof=0 1" type:"select" label:"Message Type"`
	Template  string `label:"Template" type:"textarea" placeholder:"Leave this blank to use default template"`
}

func (Lark) CreateNotification

func (lark Lark) CreateNotification(problem map[string]string) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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