Documentation
¶
Index ¶
- Variables
- func AddRefCount(requestId string)
- func CloseLogFile(requestId string)
- func FileDownloadMiddleware(path string, fp io.WriteCloser) gin.HandlerFunc
- func GenUUID() string
- func GetLogFile(requestId string) (fpOut io.WriteCloser)
- func GetLogFilePtr(c *gin.Context) (perReqLog io.WriteCloser)
- func InFileDownloadList(s string) (fn string, found bool)
- func RequestIdMiddleware() gin.HandlerFunc
- func ResetLogFile(newLf io.WriteCloser)
- func SetLogFile(requestId string, fp io.WriteCloser)
- func TimedCleanupLogFile()
- func ValidateAuthKeyHmac(AuthKey, Pw string) bool
- type LogMessage
- type RedisLogger
- type RequestLogFile
- type TfType
- func (ttf *TfType) AliveCheck(AuthKey string) bool
- func (ttf *TfType) CheckRedisWorking() (err error)
- func (ttf *TfType) NewRedisLogger(ReqId, AuthKey, clusterName string) (lm *RedisLogger, wp io.WriteCloser, err error)
- func (ttf *TfType) NewRedisLoggerFile(FileName, AuthKey, clusterName string) (lm *RedisLogger, wp io.WriteCloser, err error)
- func (ttf *TfType) RequestLogger(LogFileName, AuthKey, clusterName string) gin.HandlerFunc
Constants ¶
This section is empty.
Variables ¶
View Source
var PubSubLogIAmAliveKey = "log:-i-am-alive-"
View Source
var PubSubLogIAmAliveValue = "yes"
View Source
var PubSubLogKey = "log:pub-sub-channel:"
View Source
var URLDownloadPath string
Functions ¶
func AddRefCount ¶ added in v1.0.51
func AddRefCount(requestId string)
func CloseLogFile ¶
func CloseLogFile(requestId string)
func FileDownloadMiddleware ¶
func FileDownloadMiddleware(path string, fp io.WriteCloser) gin.HandlerFunc
func FileDownloadMiddleware(path string, fp *os.File) gin.HandlerFunc {
func GetLogFile ¶
func GetLogFile(requestId string) (fpOut io.WriteCloser)
func GetLogFile(requestId string) (fpOut *os.File) {
func GetLogFilePtr ¶
func GetLogFilePtr(c *gin.Context) (perReqLog io.WriteCloser)
func GetLogFilePtr(c *gin.Context) (perReqLog *os.File) {
func InFileDownloadList ¶
func RequestIdMiddleware ¶
func RequestIdMiddleware() gin.HandlerFunc
func SetLogFile ¶
func SetLogFile(requestId string, fp io.WriteCloser)
func SetLogFile(requestId string, fp *os.File) {
func TimedCleanupLogFile ¶
func TimedCleanupLogFile()
func ValidateAuthKeyHmac ¶ added in v1.0.58
Types ¶
type LogMessage ¶ added in v1.0.58
type RedisLogger ¶ added in v1.0.58
type RedisLogger struct {
ReqId string
FileName string
ClusterName string
AuthKey string `json:"AuthKey,omitempty"`
// contains filtered or unexported fields
}
func (RedisLogger) Close ¶ added in v1.0.58
func (ee RedisLogger) Close() (err error)
func (RedisLogger) Command ¶ added in v1.0.58
func (ee RedisLogger) Command(cmd string) (err error)
func (RedisLogger) Flush ¶ added in v1.0.58
func (ee RedisLogger) Flush() (err error)
type RequestLogFile ¶
type RequestLogFile struct {
// contains filtered or unexported fields
}
type TfType ¶ added in v1.0.58
func NewSetupTf ¶ added in v1.0.58
func (*TfType) AliveCheck ¶ added in v1.0.58
/*
type LogMessage struct {
Cmd string `json:"Cmd,omitempty"`
Data string `json:"Data,omitempty"`
ReqId string `json:"ReqId,omitempty"`
FileName string `json:"FileName,omitempty"`
ClusterName string `json:"ClusterName,omitempty"`
AuthKey string `json:"AuthKey,omitempty"`
}
*/ case "x.alive.check":
dbgo.Fprintf(logRedisLogger, "%(magenta)Received 'x.alive.check': %s\n", dbgo.SVar(message))
dbgo.Fprintf(os.Stderr, "%(magenta)Received 'x.alive.check': %s\n", dbgo.SVar(message))
xkey := "logsvr-alive:" + tf.ReqId
err := rdb.Set(ctx, xkey, tf.Data, 60*time.Second).Err() // Use ReqId as Id, use Data as Data.
if err != nil {
dbgo.Fprintf(os.Stderr, "%(red)Error setting i-am-alive message, key=%s value=%s\n", xKey, tf.Data)
dbgo.Fprintf(logRedisLogger, "%(red)Error setting i-am-alive message, key=%s value=%s\n", xKey, tf.Data)
}
func (*TfType) CheckRedisWorking ¶ added in v1.0.58
CheckRedisWorking does a test set and get to redis client rdb is setup as global in main.go this is called in main.go if UseRedis == "yes" in local cfg
func (*TfType) NewRedisLogger ¶ added in v1.0.58
func (ttf *TfType) NewRedisLogger(ReqId, AuthKey, clusterName string) (lm *RedisLogger, wp io.WriteCloser, err error)
func (*TfType) NewRedisLoggerFile ¶ added in v1.0.58
func (ttf *TfType) NewRedisLoggerFile(FileName, AuthKey, clusterName string) (lm *RedisLogger, wp io.WriteCloser, err error)
func (*TfType) RequestLogger ¶ added in v1.0.58
func (ttf *TfType) RequestLogger(LogFileName, AuthKey, clusterName string) gin.HandlerFunc
Click to show internal directories.
Click to hide internal directories.