[libvirt] [PATCH] docs: add pages to support Go module package resolution
jdenemar at redhat.com
Fri Jan 10 12:08:06 UTC 2020
On Fri, Jan 10, 2020 at 11:50:48 +0000, Daniel P. Berrangé wrote:
> On Fri, Jan 10, 2020 at 12:47:51PM +0100, Jiri Denemark wrote:
> > On Fri, Jan 10, 2020 at 10:03:28 +0000, Daniel P. Berrangé wrote:
> > > 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]
> > Can't we rename the two html file during the build process or add
> > symlinks to them to avoid messing up with apache config?
> If we rename them I believe we'll still need apache config to make it
> serve them with HTML content type since it can't match this from the
> file extension. I think the rewrite rule is suffiicently simple for
> our needs.
Hmm, you're right. Although the symlink approach should work (according
to my testing). The only problem I have with changing the apache config
is that it's completely separate from this change and in case we need to
modify this in any way, we'd need to remember to update the config too.
Reviewed-by: Jiri Denemark <jdenemar at redhat.com>
More information about the libvir-list