本文整理匯總了Golang中github.com/juju/juju/state/backups.Metadata.Size方法的典型用法代碼示例。如果您正苦於以下問題:Golang Metadata.Size方法的具體用法?Golang Metadata.Size怎麽用?Golang Metadata.Size使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/juju/juju/state/backups.Metadata
的用法示例。
在下文中一共展示了Metadata.Size方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: ResultFromMetadata
// ResultFromMetadata updates the result with the information in the
// metadata value.
func ResultFromMetadata(meta *backups.Metadata) params.BackupsMetadataResult {
var result params.BackupsMetadataResult
result.ID = meta.ID()
result.Checksum = meta.Checksum()
result.ChecksumFormat = meta.ChecksumFormat()
result.Size = meta.Size()
if meta.Stored() != nil {
result.Stored = *(meta.Stored())
}
result.Started = meta.Started
if meta.Finished != nil {
result.Finished = *meta.Finished
}
result.Notes = meta.Notes
result.Environment = meta.Origin.Environment
result.Machine = meta.Origin.Machine
result.Hostname = meta.Origin.Hostname
result.Version = meta.Origin.Version
return result
}
示例2: ResultFromMetadata
// ResultFromMetadata updates the result with the information in the
// metadata value.
func ResultFromMetadata(meta *backups.Metadata) params.BackupsMetadataResult {
var result params.BackupsMetadataResult
result.ID = meta.ID()
result.Checksum = meta.Checksum()
result.ChecksumFormat = meta.ChecksumFormat()
result.Size = meta.Size()
if meta.Stored() != nil {
result.Stored = *(meta.Stored())
}
result.Started = meta.Started
if meta.Finished != nil {
result.Finished = *meta.Finished
}
result.Notes = meta.Notes
result.Model = meta.Origin.Model
result.Machine = meta.Origin.Machine
result.Hostname = meta.Origin.Hostname
result.Version = meta.Origin.Version
result.Series = meta.Origin.Series
// TODO(wallyworld) - remove these ASAP
// These are only used by the restore CLI when re-bootstrapping.
// We will use a better solution but the way restore currently
// works, we need them and they are no longer available via
// bootstrap config. We will need to ifx how re-bootstrap deals
// with these keys to address the issue.
result.CACert = meta.CACert
result.CAPrivateKey = meta.CAPrivateKey
return result
}
示例3: checkMeta
func (s *storageSuite) checkMeta(c *gc.C, meta, expected *backups.Metadata, id string,
) {
if id != "" {
c.Check(meta.ID(), gc.Equals, id)
}
c.Check(meta.Notes, gc.Equals, expected.Notes)
c.Check(meta.Started.Unix(), gc.Equals, expected.Started.Unix())
c.Check(meta.Checksum(), gc.Equals, expected.Checksum())
c.Check(meta.ChecksumFormat(), gc.Equals, expected.ChecksumFormat())
c.Check(meta.Size(), gc.Equals, expected.Size())
c.Check(meta.Origin.Model, gc.Equals, expected.Origin.Model)
c.Check(meta.Origin.Machine, gc.Equals, expected.Origin.Machine)
c.Check(meta.Origin.Hostname, gc.Equals, expected.Origin.Hostname)
c.Check(meta.Origin.Version, gc.Equals, expected.Origin.Version)
if meta.Stored() != nil && expected.Stored() != nil {
c.Check(meta.Stored().Unix(), gc.Equals, expected.Stored().Unix())
} else {
c.Check(meta.Stored(), gc.Equals, expected.Stored())
}
}
示例4: checkMetadataResult
func (s *baseSuite) checkMetadataResult(c *gc.C, result *params.BackupsMetadataResult, meta *stbackups.Metadata) {
var finished, stored time.Time
if meta.Finished != nil {
finished = *meta.Finished
}
if meta.Stored() != nil {
stored = *(meta.Stored())
}
c.Check(result.ID, gc.Equals, meta.ID())
c.Check(result.Started, gc.Equals, meta.Started)
c.Check(result.Finished, gc.Equals, finished)
c.Check(result.Checksum, gc.Equals, meta.Checksum())
c.Check(result.ChecksumFormat, gc.Equals, meta.ChecksumFormat())
c.Check(result.Size, gc.Equals, meta.Size())
c.Check(result.Stored, gc.Equals, stored)
c.Check(result.Notes, gc.Equals, meta.Notes)
c.Check(result.Environment, gc.Equals, meta.Origin.Environment)
c.Check(result.Machine, gc.Equals, meta.Origin.Machine)
c.Check(result.Hostname, gc.Equals, meta.Origin.Hostname)
c.Check(result.Version, gc.Equals, meta.Origin.Version)
}