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

RFC: an object-oriented vmod_blob? #4255

Open
nigoroll opened this issue Jan 16, 2025 · 0 comments
Open

RFC: an object-oriented vmod_blob? #4255

nigoroll opened this issue Jan 16, 2025 · 0 comments

Comments

@nigoroll
Copy link
Member

Asking for feedback: Should we have a different interface to the encode/decode functions provided by vmod_blob? Depending on feedback, I would turn this into a VIP or not.

Quick idea draft:

$Module codec

# decoded form is a blob
$Object blob(ENUM {IDENTITY, BASE64, ...} encoding, ENUM {LOWER, UPPER, DEFAULT} case="DEFAULT"}
$Method STRING encode(BLOB)
$Method BLOB decode(STRANDS)

# decoded form is a string
$Object string(ENUM {IDENTITY, BASE64, ...} encoding, ENUM {LOWER, UPPER, DEFAULT} case="DEFAULT"}
$Method STRING encode(STRING)
$Method STRING decode(STRANDS)
sub vcl_init {
	new myurl = codec.string(URL, LOWER);
}

sub vcl_recv {
	set req.url = "/?url=" + myurl.encode(req.url);
}
``
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

1 participant