xlog

package module
v0.0.0-...-5cb72b9 Latest Latest
Warning

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

Go to latest
Published: May 12, 2024 License: MIT Imports: 7 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(debug bool, hooks ...Hook) *zap.Logger

Types

type Hook

type Hook interface {
	Process(entry zapcore.Entry) error
}

Hook can process log before output

type MsgText

type MsgText struct {
	Content string `json:"content"`
}

MsgText is text message api model

type RobotMsg

type RobotMsg struct {
	MsgType string  `json:"msgtype"`
	Text    MsgText `json:"text"`
}

RobotMsg is message api model

type WeworkSender

type WeworkSender struct {
	BaseURL  string `default:"https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key="`
	DebugKey string
	WarnKey  string
	ErrorKey string
}

WeworkSender can send notification to wechat work.

func (WeworkSender) Process

func (s WeworkSender) Process(entry zapcore.Entry) error

func (WeworkSender) SendRobotMsg

func (s WeworkSender) SendRobotMsg(key, content string) error

SendRobotMsg send robot message by wechat work web api

Jump to

Keyboard shortcuts

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