Ecosyste.ms: Packages

An open API service providing package, version and dependency metadata of many open source software ecosystems and registries.

Top 8.2% on proxy.golang.org

proxy.golang.org : github.com/nikolay-turpitko/structor

Package structor contains interface and default implementation of EL (expression language) evaluator which evaluates EL expressions within tags of the struct, using optional additional struct as an extra context. Basic idea is to use simple expression language within Go struct tags to compute struct fields based on other fields or provided additional context. Due usage of reflection and EL interpretation, this package is hardly suitable for tasks, requiring high performance, but rather intended to be used during application setup or in cases where high performance is not an ultimate goal. See tests for examples of usage with xpath, regexp, goquery, encryption, reading from files, shell invocation, etc. Example is an example of structor's usage. Whole struct tag string is used for EL expression. Interpreter based on "text/template" used to interpret it. Custom math and strings functions are used in expressions. Example_complex is a more complex example of structor's usage. Two interpreters are registered to process correspondent struct's tags. Custom strings functions are registered with custom prefix and name translations. EL uses value from other tag via execution context. One interpreter calls another to evaluate expression, got from some tag. Custom quotation marks are used in tags, when it's convenient.

Registry - Source - Documentation - JSON
purl: pkg:golang/github.com/nikolay-turpitko/structor
Keywords: el, expression-language, go, golang, goquery, regexp, scraping, struct, struct-field-visitor, struct-walker, tags, xpath
License: MIT
Latest release: over 6 years ago
First release: almost 7 years ago
Namespace: github.com/nikolay-turpitko
Stars: 2 on GitHub
Forks: 1 on GitHub
See more repository details: repos.ecosyste.ms
Last synced: 10 days ago

    Loading...
    Readme
    Loading...