本文整理汇总了Golang中gopkg/in/juju/charmrepo/v2-unstable/csclient.Client.Publish方法的典型用法代码示例。如果您正苦于以下问题:Golang Client.Publish方法的具体用法?Golang Client.Publish怎么用?Golang Client.Publish使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gopkg/in/juju/charmrepo/v2-unstable/csclient.Client
的用法示例。
在下文中一共展示了Client.Publish方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: SetPublicWithResources
// SetPublicWithResources sets the charm or bundle with the given id to be
// published with global read permissions to the stable channel.
//
// The named resources with their associated revision
// numbers are also published.
func SetPublicWithResources(c *gc.C, client *csclient.Client, id *charm.URL, resources map[string]int) {
// Publish to the stable channel.
err := client.Publish(id, []params.Channel{params.StableChannel}, resources)
c.Assert(err, jc.ErrorIsNil)
// Allow stable read permissions to everyone.
err = client.WithChannel(params.StableChannel).Put("/"+id.Path()+"/meta/perm/read", []string{params.Everyone})
c.Assert(err, jc.ErrorIsNil)
}