summaryrefslogtreecommitdiff
path: root/plugin/maxmind/maxmind_country_mmdb_in.go
diff options
context:
space:
mode:
Diffstat (limited to 'plugin/maxmind/maxmind_country_mmdb_in.go')
-rw-r--r--plugin/maxmind/maxmind_country_mmdb_in.go18
1 files changed, 17 insertions, 1 deletions
diff --git a/plugin/maxmind/maxmind_country_mmdb_in.go b/plugin/maxmind/maxmind_country_mmdb_in.go
index 1f6d5386..9bf6413e 100644
--- a/plugin/maxmind/maxmind_country_mmdb_in.go
+++ b/plugin/maxmind/maxmind_country_mmdb_in.go
@@ -18,13 +18,29 @@ const (
func init() {
lib.RegisterInputConfigCreator(TypeGeoLite2CountryMMDBIn, func(action lib.Action, data json.RawMessage) (lib.InputConverter, error) {
- return newGeoLite2CountryMMDBIn(TypeGeoLite2CountryMMDBIn, DescGeoLite2CountryMMDBIn, action, data)
+ return NewGeoLite2CountryMMDBInFromBytes(TypeGeoLite2CountryMMDBIn, DescGeoLite2CountryMMDBIn, action, data)
})
lib.RegisterInputConverter(TypeGeoLite2CountryMMDBIn, &GeoLite2CountryMMDBIn{
Description: DescGeoLite2CountryMMDBIn,
})
}
+func NewGeoLite2CountryMMDBIn(iType string, iDesc string, action lib.Action, opts ...lib.InputOption) lib.InputConverter {
+ g := &GeoLite2CountryMMDBIn{
+ Type: iType,
+ Action: action,
+ Description: iDesc,
+ }
+
+ for _, opt := range opts {
+ if opt != nil {
+ opt(g)
+ }
+ }
+
+ return g
+}
+
type GeoLite2CountryMMDBIn struct {
Type string
Action lib.Action