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

feat: add ability to set host function namespace #246

Merged
merged 6 commits into from
Feb 1, 2023

Conversation

zshipko
Copy link
Contributor

@zshipko zshipko commented Jan 31, 2023

  • Adds extism_function_set_namespace to SDK
  • Updates SDKs with host function support to allow setting the namespace for a function

@nilslice
Copy link
Member

Cool! This also reminds me we need to update the Runtime APIs page: https://extism.org/docs/concepts/runtime-apis

And should probably have a similar page for Plugin APIs.

Just a TODO for later.

C.extism_function_set_namespace(f.pointer, cstr)
}

func (f Function) WithNamespace(s string) Function {
Copy link
Member

Choose a reason for hiding this comment

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

does the method receiver here need to be a pointer type too? wonder or do you know if type checker will fail if its called on a non-pointer Function struct?

Copy link
Member

Choose a reason for hiding this comment

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

I see, this is so it can be chained on NewFunction(...).WithNamespace(...).. makes sense

@zshipko zshipko merged commit a44124b into main Feb 1, 2023
@zshipko zshipko deleted the host-function-set-namespace branch February 1, 2023 19:04
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.

None yet

2 participants