Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for network? #223

Closed
s3rj1k opened this issue Mar 7, 2024 · 3 comments
Closed

Support for network? #223

s3rj1k opened this issue Mar 7, 2024 · 3 comments

Comments

@s3rj1k
Copy link

s3rj1k commented Mar 7, 2024

Is there a plan to add networking support in-spirit of this https://www.gnu.org/software/gawk/manual/html_node/TCP_002fIP-Networking.html ?

@benhoyt
Copy link
Owner

benhoyt commented Mar 7, 2024

No, sorry, I don't really want to go down that route (to me it doesn't seem in the unix-y spirit of "do one thing well"). However, you're welcome to use system() and pipes with network-based tools like curl, or if you're using GoAWK as a Go library, you could add your own custom Go functions which do network operations: https://pkg.go.dev/github.com/benhoyt/goawk@v1.26.0/interp#Config.Funcs

@benhoyt benhoyt closed this as completed Mar 7, 2024
@s3rj1k
Copy link
Author

s3rj1k commented Mar 7, 2024

@benhoyt I actually wanted to ask next about the ability to add some kind of modules.

So if I understand correctly, I can extend GoAWK to support JSON with Config.Funcs? (when using as lib)

Also thank you for the great project.

@benhoyt
Copy link
Owner

benhoyt commented Mar 8, 2024

You could make some JSON parsing and serialisation functions with Config.Funcs, yes. However, you couldn't add first-class JSON support that would convert input lines to fields -- that's discussed as a separate feature in #152.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants