On Mon, Apr 7, 2014 at 1:40 PM, Jon Perritt <
jrpe...@gmail.com> wrote:
> and then within tokens, users, groups, etc there would be functions that
> define Create, Get, Update, Delete, etc. Then, when writing code, it would
> look something like the following:
>
> import "
github.com/rackspace/gophercloud/openstack/servicecatalog"
>
> catalog, err := servicecatalog.Get(servicecatalog.GetOpts{
> Name: "serviceId-here",
> })
>
> cr, err := servicecatalog.List(servicecatalog.ListOpts{
>
> })
>
> catalogs := servicecatalog.GetServices(cr)
This seems like a reasonable idea; however, authentication is a bit of
a special case. We get a service catalog as part of a tokens
operation, which has the side-effect of authentication as well. Then
we need a way to somehow support automatic re-authentication for those
users who don't care to manually check token expiry all the time.
We'd need to take these into consideration if we're to re-arrange the
identity SDK.
> openstack
> - identity
> - v2
> - v3
> - compute
> - storage
I'm going to oppose this idea on the basis that we'll have a plurality
of v2 and v3 modules, and no meaningful way to identify which is which
by static inspection of the code. Or, you'll end up with the equally
unidiomatic:
import (
identity ".../identity/v2"
compute ".../compute/v2"
)
On the other hand, that doesn't look all that bad. Not too happy with
the stuttering that's required, but if that's what we need to do...
I've thought of using .../v2/{identity,compute,...}, but this has some
problems that other people objected to, including difficulty of
finding related components when they're strewn about the filesystem.