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

added ability to load wasm files from binary #53

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

brennanjl
Copy link

Issue #, if available:
Issue #52

Description of changes:

  • Generated plugins now have an additional method for loading WASM plugins using an io.Reader (previously only supported filepaths).
  • Regenerated test, example, and types code to reflect the changes.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@@ -1,7 +1,7 @@
// Code generated by protoc-gen-go-plugin. DO NOT EDIT.
// versions:
// protoc-gen-go-plugin v0.1.0
// protoc v3.21.12
// protoc v3.21.1
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: use >= version of protoc

@@ -102,6 +104,14 @@ func (p *GreeterPlugin) Load(ctx context.Context, pluginPath string, hostFunctio
return nil, err
}

return p.LoadFromBinary(ctx, bytes.NewReader(b), hostFunctions)
}
func (p *GreeterPlugin) LoadFromBinary(ctx context.Context, reader io.Reader, hostFunctions HostFunctions) (greeter, error) {
Copy link
Contributor

@dmvolod dmvolod Jun 12, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@brennanjl what do you think about to add (or utilize existence one) a simple test for the LoadFromBinary function?

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

Successfully merging this pull request may close these issues.

3 participants