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

Streaming Worker Content #1498

Open
abiodunakande opened this issue Feb 7, 2024 · 0 comments
Open

Streaming Worker Content #1498

abiodunakande opened this issue Feb 7, 2024 · 0 comments

Comments

@abiodunakande
Copy link

Current cloudflare-go version

v0.87.0

Description

Currently having some issues with the worker functions on the API where a string is expected/being returned for the script content.

Could we modify the create and update params to take an interface{} rather than string to enable us to stream worker content to the api.

Use cases

Workers can be up to 10Mb in size and buffering this within my application seems wrong.

Potential cloudflare-go usage

type CreateWorkerParams struct {
        ...
	Script     interface{}
        ...
}
func (api *API) UploadWorker(....... {
    body, w := io.Pipe
    ... 
     go func() {
      api.makeRequest(....body....)
     }
     // write to body...
}

References

No response

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