1
// Copyright 2016 Canonical Ltd.
2
// Licensed under the AGPLv3, see LICENCE file for details.
9
"gopkg.in/juju/charm.v6-unstable"
10
charmresource "gopkg.in/juju/charm.v6-unstable/resource"
13
// CharmInfo holds the information about a charm from the charm store.
14
// The info relates to the charm at a particular revision at the time
15
// the charm store handled the request. The resource revisions
16
// associated with the charm at that revision may change at any time.
17
// Note, however, that the set of resource names remains fixed for any
18
// given charm revision.
19
type CharmInfo struct {
20
// OriginalURL is charm URL, including its revision, for which we
21
// queried the charm store.
22
OriginalURL *charm.URL
24
// Timestamp indicates when the info came from the charm store.
27
// LatestRevision identifies the most recent revision of the charm
28
// that is available in the charm store.
31
// LatestResources is the list of resource info for each of the
32
// charm's resources. This list is accurate as of the time that the
33
// charm store handled the request for the charm info.
34
LatestResources []charmresource.Resource
37
// LatestURL returns the charm URL for the latest revision of the charm.
38
func (info CharmInfo) LatestURL() *charm.URL {
39
return info.OriginalURL.WithRevision(info.LatestRevision)
42
// CharmInfoResult holds the result of a charm store request for info
44
type CharmInfoResult struct {
47
// Error indicates a problem retrieving or processing the info