Skip to content

Commit

Permalink
Merge branch 'fix_output_skill' into 'develop'
Browse files Browse the repository at this point in the history
fix all CheckSkill of the output driver

See merge request goku/apinto!62
  • Loading branch information
chen2eric committed Jun 28, 2022
2 parents 8c1a746 + 0eb5587 commit ca0045b
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 5 deletions.
3 changes: 2 additions & 1 deletion drivers/output/fileoutput/output.go
Original file line number Diff line number Diff line change
@@ -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"
Expand Down Expand Up @@ -72,5 +73,5 @@ func (a *FileOutput) Stop() error {
}

func (a *FileOutput) CheckSkill(skill string) bool {
return false
return output.CheckSkill(skill)
}
3 changes: 2 additions & 1 deletion drivers/output/httpoutput/output.go
Original file line number Diff line number Diff line change
@@ -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"
Expand Down Expand Up @@ -80,5 +81,5 @@ func (h *HttpOutput) Stop() error {
}

func (h *HttpOutput) CheckSkill(skill string) bool {
return false
return output.CheckSkill(skill)
}
3 changes: 2 additions & 1 deletion drivers/output/kafka/output.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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) {
Expand Down
3 changes: 2 additions & 1 deletion drivers/output/nsq/output.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package nsq

import (
"github.com/eolinker/apinto/output"
"github.com/eolinker/eosc"
"github.com/eolinker/eosc/formatter"
"sync"
Expand Down Expand Up @@ -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 {
Expand Down
3 changes: 2 additions & 1 deletion drivers/output/syslog/linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
package syslog

import (
"github.com/eolinker/apinto/output"
"github.com/eolinker/eosc"
"github.com/eolinker/eosc/formatter"
sys "log/syslog"
Expand Down Expand Up @@ -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) {
Expand Down
7 changes: 7 additions & 0 deletions output/output.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

0 comments on commit ca0045b

Please sign in to comment.