Apply .gitignore rules

This commit is contained in:
皮蛋13361098506
2025-01-06 16:21:36 +08:00
parent 1b77f62820
commit ccd2c530cf
580 changed files with 69806 additions and 0 deletions

View File

@@ -0,0 +1,10 @@
package signalMgr
// 系统信号管理包
// 提供对操作系统信号的管理支持三种信号syscall.SIGTERM, syscall.SIGINT, syscall.SIGHUP
// 其中syscall.SIGTERM, syscall.SIGINT表示程序终止信号可以绑定一个方法在系统终止时进行调用
// syscall.SIGHUP表示程序重启信号可以绑定一个方法在系统重启时进行调用
// 使用方法:
// 调用func Start(reloadFunc func() []error, exitFunc func() error)
// 传入在重启和终止时需要调用的方法如果不需要则传入nil

View File

@@ -0,0 +1,54 @@
package ensureSendUtil
import (
"fmt"
)
/*
实现sender接口
*/
type baseSender struct {
// 待发送的数据channel
waitingDataChan chan dataItem
// 失败数据缓存
cachedDataChan chan dataItem
// 用于停止协程
done chan struct{}
}
func newBaseSender() *baseSender {
return &baseSender{
waitingDataChan: make(chan dataItem, 1024),
cachedDataChan: make(chan dataItem, 1024000),
done: make(chan struct{}),
}
}
// Sender接口
// Send:
func (this *baseSender) Send() error {
// baseSender不实现发送
// 由tcpSender和httpSender实现发送
return fmt.Errorf("baseSender dose not have Send Method")
}
// Sender接口
// Data: 返回待发送的数据channel
func (this *baseSender) Data() <-chan dataItem {
return this.waitingDataChan
}
// Sender接口
// Cache返回失败数据缓存channel
func (this *baseSender) Cache() chan dataItem {
return this.cachedDataChan
}
// Sender接口
// Done返回channel用于判断是否关闭
func (this *baseSender) Done() <-chan struct{} {
return this.done
}