fix all CheckSkill of the output driver

This commit is contained in:
chenjiekun
2022-06-28 18:21:44 +08:00
parent 8c1a746754
commit 0eb558787f
6 changed files with 17 additions and 5 deletions

View File

@@ -1,6 +1,7 @@
package fileoutput
import (
"github.com/eolinker/apinto/output"
file_transport "github.com/eolinker/apinto/output/file-transport"
"github.com/eolinker/eosc"
"github.com/eolinker/eosc/formatter"
@@ -72,5 +73,5 @@ func (a *FileOutput) Stop() error {
}
func (a *FileOutput) CheckSkill(skill string) bool {
return false
return output.CheckSkill(skill)
}

View File

@@ -1,6 +1,7 @@
package httpoutput
import (
"github.com/eolinker/apinto/output"
http_transport "github.com/eolinker/apinto/output/http-transport"
"github.com/eolinker/eosc"
"github.com/eolinker/eosc/formatter"
@@ -80,5 +81,5 @@ func (h *HttpOutput) Stop() error {
}
func (h *HttpOutput) CheckSkill(skill string) bool {
return false
return output.CheckSkill(skill)
}

View File

@@ -3,6 +3,7 @@ package kafka
import (
"context"
"github.com/Shopify/sarama"
"github.com/eolinker/apinto/output"
"github.com/eolinker/eosc"
"github.com/eolinker/eosc/formatter"
"github.com/eolinker/eosc/log"
@@ -85,7 +86,7 @@ func (o *Output) Stop() error {
}
func (o *Output) CheckSkill(skill string) bool {
return false
return output.CheckSkill(skill)
}
func (o *Output) write(msg *sarama.ProducerMessage) {

View File

@@ -1,6 +1,7 @@
package nsq
import (
"github.com/eolinker/apinto/output"
"github.com/eolinker/eosc"
"github.com/eolinker/eosc/formatter"
"sync"
@@ -69,7 +70,7 @@ func (n *NsqOutput) Stop() error {
}
func (n *NsqOutput) CheckSkill(skill string) bool {
return false
return output.CheckSkill(skill)
}
func (n *NsqOutput) Output(entry eosc.IEntry) error {

View File

@@ -4,6 +4,7 @@
package syslog
import (
"github.com/eolinker/apinto/output"
"github.com/eolinker/eosc"
"github.com/eolinker/eosc/formatter"
sys "log/syslog"
@@ -87,7 +88,7 @@ func (s *SysWriter) Reset(conf interface{}, workers map[eosc.RequireId]interface
}
func (s *SysWriter) CheckSkill(skill string) bool {
return false
return output.CheckSkill(skill)
}
func newSysWriter(conf *Config, tag string) (*sys.Writer, error) {

View File

@@ -2,6 +2,13 @@ package output
import "github.com/eolinker/eosc"
const OutputSkill = "github.com/eolinker/apinto/http-entry.http-entry.IOutput"
type IEntryOutput interface {
Output(entry eosc.IEntry) error
}
//CheckSkill 检查能力
func CheckSkill(skill string) bool {
return skill == OutputSkill
}