當前位置: 首頁>>代碼示例>>Golang>>正文


Golang BackupsMetadataResult.Notes方法代碼示例

本文整理匯總了Golang中github.com/juju/juju/apiserver/params.BackupsMetadataResult.Notes方法的典型用法代碼示例。如果您正苦於以下問題:Golang BackupsMetadataResult.Notes方法的具體用法?Golang BackupsMetadataResult.Notes怎麽用?Golang BackupsMetadataResult.Notes使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在github.com/juju/juju/apiserver/params.BackupsMetadataResult的用法示例。


在下文中一共展示了BackupsMetadataResult.Notes方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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
}
開發者ID:imoapps,項目名稱:juju,代碼行數:27,代碼來源:backups.go

示例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
}
開發者ID:bac,項目名稱:juju,代碼行數:37,代碼來源:backups.go

示例3: TestCreateNotes

func (s *backupsSuite) TestCreateNotes(c *gc.C) {
	meta := s.newMeta("this backup is important")
	s.setBackups(c, meta, "")
	args := params.BackupsCreateArgs{
		Notes: "this backup is important",
	}
	result, err := s.api.Create(args)
	c.Assert(err, gc.IsNil)
	var expected params.BackupsMetadataResult
	expected.UpdateFromMetadata(meta)
	expected.Notes = "this backup is important"

	c.Check(result, gc.DeepEquals, expected)
}
開發者ID:zhouqt,項目名稱:juju,代碼行數:14,代碼來源:create_test.go


注:本文中的github.com/juju/juju/apiserver/params.BackupsMetadataResult.Notes方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。