Giter Site home page Giter Site logo

wasm-outbound-http-examples / go-plugin Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 5 KB

Make HTTP requests from inside WASM using knqyf263/go-plugin . Devcontainer.

License: MIT License

Shell 15.18% Go 84.82%
go-plugin golang http-client http-request tinygo wasi wasm webassembly

go-plugin's Introduction

Use knqyf263/go-plugin to send HTTP(s) requests from inside WASM

This devcontainer is configured to provide you a knqyf263/go-plugin's CLI tool installation, Go and TinyGo toolchains, and a protobuf-compiler.

Open in GitHub Codespaces

The sample code and following instructions are partially based on go-plugin's examples and go-plugin's tutorial.

Instructions for this devcontainer

Tested with protoc-gen-go-plugin 0.8.0, protobuf-compiler 3.12.4, Go 1.21.7, TinyGo 0.30.0.

Preparation

  1. Open this repo in devcontainer, e.g. using Github Codespaces. Type or copy/paste following commands to devcontainer's terminal.

Building

  1. Generate the SDK codes based on interfaces declared in protobufs/myschema.proto file:
cd protobufs
protoc --go-plugin_out=. --go-plugin_opt=paths=source_relative myschema.proto

This will generate 4 new .go files in protobufs directory.

  1. Compile the plugin sample:
cd ../plugin
tinygo build -o plugin.wasm -scheduler=none -target=wasi --no-debug plugin.go

This will generate plugin.wasm in plugin directory.

  1. Run the main ("host") program, which makes use of the plugin.wasm:
cd ..
go run main.go

Finish

Perform your own experiments if desired.


Created for (wannabe-awesome) list

go-plugin's People

Contributors

vasilev avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.