本文整理汇总了Golang中github.com/wallyworld/core/environs/storage.Storage.Remove方法的典型用法代码示例。如果您正苦于以下问题:Golang Storage.Remove方法的具体用法?Golang Storage.Remove怎么用?Golang Storage.Remove使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/wallyworld/core/environs/storage.Storage
的用法示例。
在下文中一共展示了Storage.Remove方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: RemoveFakeToolsMetadata
// RemoveFakeToolsMetadata deletes the fake simplestreams tools metadata from the supplied storage.
func RemoveFakeToolsMetadata(c *gc.C, stor storage.Storage) {
files := []string{simplestreams.UnsignedIndex, envtools.ProductMetadataPath}
for _, file := range files {
toolspath := path.Join("tools", file)
err := stor.Remove(toolspath)
c.Check(err, gc.IsNil)
}
}
示例2: RemoveTools
// RemoveTools deletes all tools from the supplied storage.
func RemoveTools(c *gc.C, stor storage.Storage) {
names, err := storage.List(stor, "tools/releases/juju-")
c.Assert(err, gc.IsNil)
c.Logf("removing files: %v", names)
for _, name := range names {
err = stor.Remove(name)
c.Check(err, gc.IsNil)
}
RemoveFakeToolsMetadata(c, stor)
}
示例3: RemoveFakeTools
// RemoveFakeTools deletes the fake tools from the supplied storage.
func RemoveFakeTools(c *gc.C, stor storage.Storage) {
c.Logf("removing fake tools")
toolsVersion := version.Current
name := envtools.StorageName(toolsVersion)
err := stor.Remove(name)
c.Check(err, gc.IsNil)
defaultSeries := coretesting.FakeDefaultSeries
if version.Current.Series != defaultSeries {
toolsVersion.Series = defaultSeries
name := envtools.StorageName(toolsVersion)
err := stor.Remove(name)
c.Check(err, gc.IsNil)
}
RemoveFakeToolsMetadata(c, stor)
}
示例4: DeleteStateFile
// DeleteStateFile deletes the state file on the given storage.
func DeleteStateFile(stor storage.Storage) error {
return stor.Remove(StateFile)
}
示例5: RemoveTestImageData
func RemoveTestImageData(stor storage.Storage) {
stor.Remove(simplestreams.DefaultIndexPath + ".json")
stor.Remove(productMetadatafile)
}