summaryrefslogtreecommitdiff
path: root/plugin/maxmind/maxmind_country_mmdb_out.go
diff options
context:
space:
mode:
authorcopilot-swe-agent[bot] <[email protected]>2026-04-28 18:24:00 +0000
committerGitHub <[email protected]>2026-04-28 18:24:00 +0000
commit8834c0be63ee88e0ad23fe621d5f5fe344b32089 (patch)
tree49029d2fd927e8832d05420d1bf1cf850aa22325 /plugin/maxmind/maxmind_country_mmdb_out.go
parent4f125e579472e5ed87fd052ef68ab80f5fe679b0 (diff)
Refactor all plugins to use functional options patterncopilot/refactor-plugins-functional-options
Agent-Logs-Url: https://github.com/Loyalsoldier/geoip/sessions/e2b66c9a-3d01-490c-9b31-32109cfe4feb Co-authored-by: Loyalsoldier <[email protected]>
Diffstat (limited to 'plugin/maxmind/maxmind_country_mmdb_out.go')
-rw-r--r--plugin/maxmind/maxmind_country_mmdb_out.go20
1 files changed, 10 insertions, 10 deletions
diff --git a/plugin/maxmind/maxmind_country_mmdb_out.go b/plugin/maxmind/maxmind_country_mmdb_out.go
index fc72e83c..1bbaad6e 100644
--- a/plugin/maxmind/maxmind_country_mmdb_out.go
+++ b/plugin/maxmind/maxmind_country_mmdb_out.go
@@ -22,14 +22,14 @@ const (
func init() {
lib.RegisterOutputConfigCreator(TypeGeoLite2CountryMMDBOut, func(action lib.Action, data json.RawMessage) (lib.OutputConverter, error) {
- return newGeoLite2CountryMMDBOut(TypeGeoLite2CountryMMDBOut, DescGeoLite2CountryMMDBOut, action, data)
+ return NewGeoLite2CountryMMDBOutFromBytes(TypeGeoLite2CountryMMDBOut, DescGeoLite2CountryMMDBOut, action, data)
})
- lib.RegisterOutputConverter(TypeGeoLite2CountryMMDBOut, &GeoLite2CountryMMDBOut{
+ lib.RegisterOutputConverter(TypeGeoLite2CountryMMDBOut, &geoLite2CountryMMDBOut{
Description: DescGeoLite2CountryMMDBOut,
})
}
-type GeoLite2CountryMMDBOut struct {
+type geoLite2CountryMMDBOut struct {
Type string
Action lib.Action
Description string
@@ -43,19 +43,19 @@ type GeoLite2CountryMMDBOut struct {
SourceMMDBURI string
}
-func (g *GeoLite2CountryMMDBOut) GetType() string {
+func (g *geoLite2CountryMMDBOut) GetType() string {
return g.Type
}
-func (g *GeoLite2CountryMMDBOut) GetAction() lib.Action {
+func (g *geoLite2CountryMMDBOut) GetAction() lib.Action {
return g.Action
}
-func (g *GeoLite2CountryMMDBOut) GetDescription() string {
+func (g *geoLite2CountryMMDBOut) GetDescription() string {
return g.Description
}
-func (g *GeoLite2CountryMMDBOut) Output(container lib.Container) error {
+func (g *geoLite2CountryMMDBOut) Output(container lib.Container) error {
dbName := ""
dbDesc := ""
dbLanguages := []string{"en"}
@@ -119,7 +119,7 @@ func (g *GeoLite2CountryMMDBOut) Output(container lib.Container) error {
return nil
}
-func (g *GeoLite2CountryMMDBOut) filterAndSortList(container lib.Container) []string {
+func (g *geoLite2CountryMMDBOut) filterAndSortList(container lib.Container) []string {
/*
Note: The IPs and/or CIDRs of the latter list will overwrite those of the former one
when duplicated data found due to MaxMind mmdb file format constraint.
@@ -175,7 +175,7 @@ func (g *GeoLite2CountryMMDBOut) filterAndSortList(container lib.Container) []st
return list
}
-func (g *GeoLite2CountryMMDBOut) marshalData(writer *mmdbwriter.Tree, entry *lib.Entry, extraInfo map[string]any) error {
+func (g *geoLite2CountryMMDBOut) marshalData(writer *mmdbwriter.Tree, entry *lib.Entry, extraInfo map[string]any) error {
entryCidr, err := entry.MarshalText(lib.GetIgnoreIPType(g.OnlyIPType))
if err != nil {
return err
@@ -371,7 +371,7 @@ func (g *GeoLite2CountryMMDBOut) marshalData(writer *mmdbwriter.Tree, entry *lib
return nil
}
-func (g *GeoLite2CountryMMDBOut) writeFile(filename string, writer *mmdbwriter.Tree) error {
+func (g *geoLite2CountryMMDBOut) writeFile(filename string, writer *mmdbwriter.Tree) error {
if err := os.MkdirAll(g.OutputDir, 0755); err != nil {
return err
}