sync

package
v0.0.0-...-9b1755c Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2021 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckRestful

func CheckRestful(restfulMsgs []*RestfulMsg, restfulURL []string, logger *logging.Logger)

CheckRestful 接口监控

func CheckService

func CheckService(logger *logging.Logger)

CheckService 监控服务

func SyncDevice

func SyncDevice(logger *logging.Logger)

func SyncDeviceLog

func SyncDeviceLog(logMsgs []*LogMsg, logCodes []string, loggerD *logging.Logger, ca *cache.Cache)

SyncDeviceLog 扫描设备日志

Types

type FaultLog

type FaultLog struct {
	AppType        string `json:"appType"`
	Call           Plugin `json:"call"`
	Face           Plugin `json:"face"`
	Interf         Plugin `json:"interf"`
	Iptv           Plugin `json:"iptv"`
	Mqtt           Plugin `json:"mqtt"`
	IsBackground   bool   `json:"isBackground"`
	IsEmptyBed     bool   `json:"isEmptyBed"`
	IsMainActivity bool   `json:"isMainActivity"`
	Timestamp      string `json:"timestamp"`
}

fault.log 文件内容 bis:床旁 nws: 护士站主机 webapp:门旁

type FaultTxt

type FaultTxt struct {
	Reason    string `json:"reason"`
	Mqtt      bool   `json:"mqtt"`
	Timestamp string `json:"timestamp"`
}

fault.txt 文件内容 nis : 护理大屏

type FileInfo

type FileInfo struct {
	Name    string
	Content string
	Time    string
}

type InterfaceLog

type InterfaceLog struct {
	Msg           string `json:"msg"`
	PostParamJson string `json:"postParamJson"`
	PostParamType int    `json:"postParamType"`
	Remark        string `json:"remark"`
	RequestType   int    `json:"requestType"`
	Timestamp     string `json:"timestamp"`
	Url           string `json:"url"`
}

interface.log requestType为0表示get请求,为1表示post请求, postParamType为0表示post请求的参数为Map, postParamType为1表示post请求的参数为Json,code为-1表示返回体为空,code为-2表示JSON解析出错

type LogMsg

type LogMsg struct {
	DevIp          string `json:"device_ip"` // 服务id
	DevType        int64  `json:"device_type_id"`
	DirName        string `json:"dir_name"`    //系统类型,bis/nis/nws/webapp
	DeviceCode     string `json:"device_code"` //设备编码
	FaultMsg       string `json:"fault_msg"`   //故障信息
	StatusMsg      string `json:"wechat_msg"`  //状态信息
	DeviceImg      string `json:"device_img"`  //设备截图
	Status         bool   `json:"status"`
	StatusType     string `json:"status_type"` //故障类型,设备异常,插件异常,日志异常
	InterfaceError int    `json:"interface_error"`
	Call           string `json:"call"`
	Face           string `json:"face"`
	Interf         string `json:"interf"`
	Iptv           string `json:"iptv"`
	Mqtt           string `json:"mqtt"`
	CallCode       string `json:"call_code"`
	FaceCode       string `json:"face_code"`
	InterfCode     string `json:"interf_code"`
	IptvCode       string `json:"iptv_code"`
	MqttCode       string `json:"mqtt_code"`
	IsBackground   string `json:"is_background"`
	IsEmptyBed     string `json:"is_empty_bed"`
	IsMainActivity string `json:"is_main_activity"`
	Timestamp      string `json:"timestamp"`
}

type Plugin

type Plugin struct {
	Code   string `json:"code"`
	Reason string `json:"reason"`
}

type RabbitMQ

type RabbitMQ struct {

	// 队列名称
	QueueName string
	// 交换机
	Exchange string
	// Key
	Key string
	// 连接信息
	Mqurl string
	// contains filtered or unexported fields
}

func NewRabbitMQ

func NewRabbitMQ(queueName, mqurl, exchange, key string) (*RabbitMQ, error)

NewRabbitMQ 创建结构体实例

func NewRabbitMQSimple

func NewRabbitMQSimple(queueName, mqurl string) (*RabbitMQ, error)

NewRabbitMQSimple 简单模式Step 1.创建简单模式下的RabbitMq实例

func (*RabbitMQ) Destory

func (r *RabbitMQ) Destory()

Destory 断开channel和connection

type RestfulMsg

type RestfulMsg struct {
	Url    string `json:"url" gorm:"column:url"`
	Status bool   `json:"status" gorm:"column:status"`
	ErrMsg string `json:"err_msg" gorm:"column:err_msg"`
}

type RestfulResponse

type RestfulResponse struct {
	Status int64       `json:"code"`
	Msg    string      `json:"message"`
	Data   interface{} `json:"data"`
}

RestfulResponse

Jump to

Keyboard shortcuts

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