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

import (
	"encoding/json"

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

const (
	TypeJSONIn = "json"
	DescJSONIn = "Convert JSON data to other formats"
)

func init() {
	lib.RegisterInputConfigCreator(TypeJSONIn, func(action lib.Action, data json.RawMessage) (lib.InputConverter, error) {
		return NewTextInFromBytes(TypeJSONIn, DescJSONIn, action, data)
	})

	lib.RegisterInputConverter(TypeJSONIn, &textIn{
		Description: DescJSONIn,
	})
}