Skip to contentSkip to conversation

initialize xenlight go module

PATCH In review Nick Rosbrook 2 participants 3 messages May 13, 2020

lore
Share & tools
lore
#0 lore raw

v3 cover initialize xenlight go module

These patches setup an initial Go module for the xenlight package. The go code is tracked again, since the module is defined in xen.git as xenbits.xenproject.org/git-http/xen.git/tools/golang/xenlight. The final patch adds a README and LICENSE to tools/golang/xenlight so that the package will show up properly on pkg.go.dev and be available via the module proxy at proxy.golang.org.

Changes in v2:
- Use xenproject.org instead of xen.org in module path.
- Use go build instead of go install in xenlight Makefile.
- Use LGPL instead of GPL for xenlight LICENSE.
- Add entry for xenlight package in SUPPORT.md.
- Change some wording in the README for clarity.

Changes in v3:
- Use LGPL as-is from [1].
- Wrap lines in README.

[1] https://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt

Nick Rosbrook (1):
golang/xenlight: add necessary module/package documentation

 SUPPORT.md                        |   6 +
 tools/golang/xenlight/LICENSE     | 502 ++++++++++++++++++++++++++++++
 tools/golang/xenlight/README.md   |  28 ++
 tools/golang/xenlight/xenlight.go |   2 +
 4 files changed, 538 insertions(+)
 create mode 100644 tools/golang/xenlight/LICENSE
 create mode 100644 tools/golang/xenlight/README.md
Signature · 1 line
2.17.1
#1 lore raw

PATCH v3 1/1 golang/xenlight: add necessary module/package documentation

Add a README and package comment giving a brief overview of the package. These also help pkg.go.dev generate better documentation.

Also, add a copy of the LGPL (the same license used by libxl) to tools/golang/xenlight. This is required for the package to be shown on pkg.go.dev and added to the default module proxy, proxy.golang.org.

Finally, add an entry for the xenlight package to SUPPORT.md.

---
Changes in v2:
- Use LGPL instead of GPL for license.
- Change some wording in README for clarity.
- Add entry to SUPPORT.md for xenlight package.

Changes in v3:
- Use LGPL as-is, not from tools/ocaml.
- Wrap lines in README.

---
 SUPPORT.md                        |   6 +
 tools/golang/xenlight/LICENSE     | 502 ++++++++++++++++++++++++++++++
 tools/golang/xenlight/README.md   |  28 ++
 tools/golang/xenlight/xenlight.go |   2 +
 4 files changed, 538 insertions(+)
 create mode 100644 tools/golang/xenlight/LICENSE
 create mode 100644 tools/golang/xenlight/README.md
SUPPORT.md +6 -0
index 7270c9b021..e3a366fd56 100644
@@ -147,6 +147,12 @@ Output of information in machine-parseable JSON format
 
     Status: Supported
 
+### xenlight Go package
+
+Go (golang) bindings for libxl
+
+    Status: Experimental
+
 ## Toolstack/3rd party
 
 ### libvirt driver for xl
tools/golang/xenlight/LICENSE new file +502 -0

502 lines not on this page · raw message

tools/golang/xenlight/README.md new file +28 -0
new file mode 100644
index 0000000000..a423a5600a
@@ -0,0 +1,28 @@
+# xenlight
+
+## About
+
+The xenlight package provides Go bindings to Xen's libxl C library via cgo.
+The package is currently in an unstable "experimental" state. This means
+the package is ready for initial use and evaluation, but is not yet fully
+functional. Namely, only a subset of libxl's API is implemented, and
+breaking changes may occur in future package versions.
+
+Much of the package is generated using the libxl IDL. Changes to the
+generated code can be made by modifying `tools/golang/xenlight/gengotypes.py`
+in the xen.git tree.
+
+## Getting Started
+
+```go
+import (
+        "xenbits.xenproject.org/git-http/xen.git/tools/golang/xenlight"
+)
+```
+
+The module is not yet tagged independently of xen.git; if you don’t specify
+the version, you’ll get the most recent development version, which is
+probably not what you want. A better option would be to specify a Xen
+release tag; for instance:
+
+    go get xenbits.xenproject.org/git-http/xen.git/tools/golang/[email protected].
tools/golang/xenlight/xenlight.go +2 -0
index 6b4f492550..3eaa5a3d63 100644
@@ -14,6 +14,8 @@
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library; If not, see <http://www.gnu.org/licenses/>.
  */
+
+// Package xenlight provides bindings to Xen's libxl C library.
 package xenlight
 
 /*
Signature · 1 line
2.17.1
Reviewed-by on v3 1/1
#2 lore raw

Re: [PATCH v3 1/1] golang/xenlight: add necessary module/package documentation

Quoted 7 lines · Nick Rosbrook

Add a README and package comment giving a brief overview of the package. These also help pkg.go.dev generate better documentation.

Quoted 7 lines

Also, add a copy of the LGPL (the same license used by libxl) to tools/golang/xenlight. This is required for the package to be shown on pkg.go.dev and added to the default module proxy, proxy.golang.org.

Finally, add an entry for the xenlight package to SUPPORT.md.