提交 201156ec 编写于 作者: D Daniel P. Berrangé

docs: add pages to support Go module package resolution

Currently the libvirt Go modules are accessed by applications using
their github repository URLs. This is undesirable as we don't want
applications to have a direct dependancy on a specific source repo
location. We want to enable applications to use the Go packages via
the libvirt.org namespace.

When you do "go get libvirt.org/libvirt-go", the Go client will do an
HTTPS request to that URL, and parse the HTML content to look for a
<meta> tag which tells it where to the find the GIT repository.

   https://golang.org/cmd/go/#hdr-Remote_import_paths

This adds two pages to support this Go module resolution. They are
not linked from anywhere as we don't expect users to actually look
at them. If someone does happen upon them, there's some boilerplate
text to send them off to godoc.org for API documentation.

Since the pages we're adding have a .html extension, we will also
use a small apache config tweak on the server

    RewriteEngine on
    RewriteRule ^/libvirt-go$ /libvirt-go.html [L]
    RewriteRule ^/libvirt-go-xml$ /libvirt-go-xml.html [L]
Reviewed-by: NJiri Denemark <jdenemar@redhat.com>
Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
上级 d6006672
==========================
Libvirt Go XML parsing API
==========================
The `Go <https://golang.org/>`__ package ``libvirt.org/libvirt-go-xml`` provides
annotated Go struct definitions for parsing (and formatting) XML documents used
with libvirt APIs.
For details of Go specific behaviour consult the
`Go package documentation <https://godoc.org/libvirt.org/libvirt-go-xml>`__
=======================
Libvirt Go Language API
=======================
The `Go <https://golang.org/>`__ package ``libvirt.org/libvirt-go`` provides
`CGo <https://golang.org/cmd/cgo/>`__ binding from the OS native Libvirt API.
In general the Go representation is a direct 1-1 mapping from native API
concepts to Go, so the native API documentation should serve as a reference
for most behaviour.
For details of Go specific behaviour consult the
`Go package documentation <https://godoc.org/libvirt.org/libvirt-go>`__
......@@ -99,6 +99,12 @@
<meta name="theme-color" content="#ffffff"/>
<title>libvirt: <xsl:value-of select="html:html/html:body//html:h1"/></title>
<meta name="description" content="libvirt, virtualization, virtualization API"/>
<xsl:if test="$pagename = 'libvirt-go.html'">
<meta name="go-import" content="libvirt.org/libvirt-go git https://libvirt.org/git/libvirt-go.git"/>
</xsl:if>
<xsl:if test="$pagename = 'libvirt-go-xml.html'">
<meta name="go-import" content="libvirt.org/libvirt-go-xml git https://libvirt.org/git/libvirt-go-xml.git"/>
</xsl:if>
<xsl:apply-templates select="/html:html/html:head/html:script" mode="content"/>
<script type="text/javascript" src="{$href_base}js/main.js">
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册