规划过滤方法

This commit is contained in:
白茶清欢 2022-07-04 11:58:34 +08:00
parent b5ae4cf809
commit 267a813e66
3 changed files with 36 additions and 1 deletions

30
filter.go Normal file
View File

@ -0,0 +1,30 @@
// Package util ...
//
// Description : util ...
//
// Author : go_developer@163.com<白茶清欢>
//
// Date : 2022-07-04 11:45
package util
// NewFilter 过滤器实例
//
// Author : go_developer@163.com<白茶清欢>
//
// Date : 11:54 2022/7/4
func NewFilter(sourceData []byte, filterRule map[string]string) *filter {
return &filter{
sourceData: sourceData,
filterRule: filterRule,
}
}
// filter 数据过滤
//
// Author : go_developer@163.com<白茶清欢>
//
// Date : 11:58 2022/7/4
type filter struct {
sourceData []byte
filterRule map[string]string
}

5
go.mod
View File

@ -8,4 +8,7 @@ require (
gopkg.in/yaml.v3 v3.0.1
)
require github.com/go-ini/ini v1.66.6 // indirect
require (
github.com/Jeffail/gabs v1.4.0 // indirect
github.com/go-ini/ini v1.66.6 // indirect
)

2
go.sum
View File

@ -1,3 +1,5 @@
github.com/Jeffail/gabs v1.4.0 h1://5fYRRTq1edjfIrQGvdkcd22pkYUrHZ5YC/H2GJVAo=
github.com/Jeffail/gabs v1.4.0/go.mod h1:6xMvQMK4k33lb7GUUpaAPh6nKMmemQeg5d4gn7/bOXc=
github.com/go-ini/ini v1.66.6 h1:h6k2Bb0HWS/BXXHCXj4QHjxPmlIU4NK+7MuLp9SD+4k=
github.com/go-ini/ini v1.66.6/go.mod h1:ByCAeIL28uOIIG0E3PJtZPDL8WnHpFKFOtgjp+3Ies8=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=