sgn
github.com/pcj/starlark-go-nethttp
go get github.com/pcj/starlark-go-nethttp
sgn

github.com/pcj/starlark-go-nethttp

http module for starlark-go

by Paul Cody Johnston

v0.0.0-20181206163746-4f030cb7e2df (see all)License:BSD-3-Clause
go get github.com/pcj/starlark-go-nethttp
Readme

starlark-go-nethttp

A wrapper around a minimal subset of net/http package for use within starlark-go.

Documentation

Getting started

Build the code:

# check out the code and dependencies,
# and install interpreter in $GOPATH/bin
$ go get -u github.com/pcj/starlark-go-nethttp

Run the interpreter or interact with the read-eval-print loop (REPL):

$ nethttp
>>> resp = http.get("https://google.com")
>>> resp.code
200
>>>

When you have finished, type Ctrl-D to close the REPL's input stream.

Embedding

To embed the module within your own configuration language, add it to your globals:

globals := starlark.StringDict{
    "http": nethttp.NewModule(),
}

Contributing

Contributions welcome.

GitHub Stars

12

LAST COMMIT

3yrs ago

MAINTAINERS

0

CONTRIBUTORS

1

OPEN ISSUES

0

OPEN PRs

1
VersionTagPublished
v0.0.0-20181206163746-4f030cb7e2df
2yrs ago
No alternatives found
No tutorials found
Add a tutorial