本文整理汇总了Golang中github.com/juju/juju/state.Space类的典型用法代码示例。如果您正苦于以下问题:Golang Space类的具体用法?Golang Space怎么用?Golang Space使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Space类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: assertSpace
func assertSpace(c *gc.C, space *state.Space, name string, subnets []string, isPublic bool) {
c.Assert(space.Name(), gc.Equals, name)
actualSubnets, err := space.Subnets()
c.Assert(err, jc.ErrorIsNil)
actualSubnetIds := make([]string, len(actualSubnets))
for i, subnet := range actualSubnets {
actualSubnetIds[i] = subnet.CIDR()
}
c.Assert(actualSubnetIds, jc.SameContents, subnets)
c.Assert(state.SpaceDoc(space).IsPublic, gc.Equals, isPublic)
c.Assert(space.Life(), gc.Equals, state.Alive)
c.Assert(strings.HasSuffix(space.ID(), name), jc.IsTrue)
c.Assert(space.String(), gc.Equals, name)
}
示例2: assertSpaceMatchesArgs
func (s *SpacesSuite) assertSpaceMatchesArgs(c *gc.C, space *state.Space, args addSpaceArgs) {
c.Assert(space.Name(), gc.Equals, args.Name)
c.Assert(space.ProviderId(), gc.Equals, args.ProviderId)
actualSubnets, err := space.Subnets()
c.Assert(err, jc.ErrorIsNil)
actualSubnetIds := make([]string, len(actualSubnets))
for i, subnet := range actualSubnets {
actualSubnetIds[i] = subnet.CIDR()
}
c.Assert(actualSubnetIds, jc.SameContents, args.SubnetCIDRs)
c.Assert(state.SpaceDoc(space).IsPublic, gc.Equals, args.IsPublic)
c.Assert(space.Life(), gc.Equals, state.Alive)
c.Assert(space.String(), gc.Equals, args.Name)
}
示例3: removeSpaceAndAssertNotFound
func (s *SpacesSuite) removeSpaceAndAssertNotFound(c *gc.C, space *state.Space) {
err := space.Remove()
c.Assert(err, jc.ErrorIsNil)
s.assertSpaceNotFound(c, space.Name())
}
示例4: refreshAndAssertSpaceLifeIs
func (s *SpacesSuite) refreshAndAssertSpaceLifeIs(c *gc.C, space *state.Space, expectedLife state.Life) {
err := space.Refresh()
c.Assert(err, jc.ErrorIsNil)
c.Assert(space.Life(), gc.Equals, expectedLife)
}
示例5: ensureDeadAndAssertLifeIsDead
func (s *SpacesSuite) ensureDeadAndAssertLifeIsDead(c *gc.C, space *state.Space) {
err := space.EnsureDead()
c.Assert(err, jc.ErrorIsNil)
c.Assert(space.Life(), gc.Equals, state.Dead)
}