本文整理匯總了Golang中github.com/juju/juju/state.Space.Name方法的典型用法代碼示例。如果您正苦於以下問題:Golang Space.Name方法的具體用法?Golang Space.Name怎麽用?Golang Space.Name使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/juju/juju/state.Space
的用法示例。
在下文中一共展示了Space.Name方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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())
}