summaryrefslogtreecommitdiff
path: root/plugin/plaintext/text_in.go
diff options
context:
space:
mode:
authorLoyalsoldier <[email protected]>2024-08-06 04:48:42 +0800
committerLoyalsoldier <[email protected]>2024-08-06 04:48:42 +0800
commitb5b24293ef86fd00d2673b1133b853a511ef9211 (patch)
tree5c9019c9e6f840a5d251f3afd53aa44efedbf14f /plugin/plaintext/text_in.go
parentee3687e191acbde3aabc13cf4f5dca93a3d80af5 (diff)
Feat: support extended text format with prefix & suffix in line as input
IP and CIDR with prefix and suffix in one line now can be processed by using `text` format as input, specified by args `removePrefixesInLine` and `removeSuffixesInLine`.
Diffstat (limited to 'plugin/plaintext/text_in.go')
-rw-r--r--plugin/plaintext/text_in.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/plugin/plaintext/text_in.go b/plugin/plaintext/text_in.go
index 6ebf15d9..d9aea269 100644
--- a/plugin/plaintext/text_in.go
+++ b/plugin/plaintext/text_in.go
@@ -32,6 +32,9 @@ func newTextIn(iType string, action lib.Action, data json.RawMessage) (lib.Input
URI string `json:"uri"`
InputDir string `json:"inputDir"`
OnlyIPType lib.IPType `json:"onlyIPType"`
+
+ RemovePrefixesInLine []string `json:"removePrefixesInLine"`
+ RemoveSuffixesInLine []string `json:"removeSuffixesInLine"`
}
if strings.TrimSpace(iType) == "" {
@@ -60,6 +63,9 @@ func newTextIn(iType string, action lib.Action, data json.RawMessage) (lib.Input
URI: tmp.URI,
InputDir: tmp.InputDir,
OnlyIPType: tmp.OnlyIPType,
+
+ RemovePrefixesInLine: tmp.RemovePrefixesInLine,
+ RemoveSuffixesInLine: tmp.RemoveSuffixesInLine,
}, nil
}