Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

57 Commits

Repository files navigation

Hyperscale Filter Last releaseDocumentation

Go Report Card

BranchStatusCoverage
masterBuild StatusCoveralls

The Hyperscale Filter library provides a set of commonly needed data filters. It also provides a simple filter chaining mechanism by which multiple filters may be applied to a single datum in a user-defined order.

Example

Filter by map[string]interface{}

package main
import (
"fmt""github.com/hyperscale-stack/filter"
)
funcmain() {
i:=NewInputFilter(map[string][]Filter{
"email": {
NewStringToLowerFilter(),
},
})
value, err:=i.FilterMap(map[string]interface{}{
"email": "STEVE@APPLE.COM",
})
// return // map[string]interface{}{// "email": "steve@apple.com",// }
}

Filter by url.Values

package main
import (
"fmt""github.com/hyperscale-stack/filter"
)
funcmain() {
i:=NewInputFilter(map[string][]Filter{
"email": {
NewStringToLowerFilter(),
},
})
values:= url.Values{}
values.Set("email", "STEVE@APPLE.COM")
value, err:=i.FilterValues(values)
// return // url.Values{// "email": []string{"steve@apple.com"},// }
}

License

Hyperscale Filter is licensed under the MIT license.

About

The Hyperscale Filter library provides a set of commonly needed data filters. It also provides a simple filter chaining mechanism by which multiple filters may be applied to a single datum in a user-defined order.

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages