summaryrefslogtreecommitdiff
path: root/plugin/plaintext/surge_out.go
blob: 30aa23322843a022fec6993c4c55b68fd6845c1d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
package plaintext

import (
	"encoding/json"

	"github.com/Loyalsoldier/geoip/lib"
)

/*
The types in this file extend the type `typeTextOut`,
which make it possible to support more formats for the project.
*/

const (
	TypeSurgeRuleSetOut = "surgeRuleSet"
	DescSurgeRuleSetOut = "Convert data to Surge RuleSet"
)

func init() {
	lib.RegisterOutputConfigCreator(TypeSurgeRuleSetOut, func(action lib.Action, data json.RawMessage) (lib.OutputConverter, error) {
		return NewTextOutFromBytes(TypeSurgeRuleSetOut, DescSurgeRuleSetOut, action, data)
	})
	lib.RegisterOutputConverter(TypeSurgeRuleSetOut, &text_out{
		Description: DescSurgeRuleSetOut,
	})
}