~dstroppa/juju-core/joyent-provider-storage

« back to all changes in this revision

Viewing changes to state/charm.go

  • Committer: Daniele Stroppa
  • Date: 2014-01-08 15:58:10 UTC
  • mfrom: (1953.1.231 juju-core)
  • Revision ID: daniele.stroppa@joyent.com-20140108155810-xecbwrqkb5i0fyoe
Merging trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
11
11
 
12
12
// charmDoc represents the internal state of a charm in MongoDB.
13
13
type charmDoc struct {
14
 
        URL          *charm.URL `bson:"_id"`
15
 
        Meta         *charm.Meta
16
 
        Config       *charm.Config
17
 
        BundleURL    *url.URL
18
 
        BundleSha256 string
 
14
        URL           *charm.URL `bson:"_id"`
 
15
        Meta          *charm.Meta
 
16
        Config        *charm.Config
 
17
        BundleURL     *url.URL
 
18
        BundleSha256  string
 
19
        PendingUpload bool
19
20
}
20
21
 
21
22
// Charm represents the state of a charm in the environment.
64
65
func (c *Charm) BundleSha256() string {
65
66
        return c.doc.BundleSha256
66
67
}
 
68
 
 
69
// IsUploaded returns whether the charm has been uploaded to the
 
70
// provider storage.
 
71
func (c *Charm) IsUploaded() bool {
 
72
        return !c.doc.PendingUpload
 
73
}