本文整理汇总了Golang中github.com/juju/gomaasapi.CreateSubnet.GatewayIP方法的典型用法代码示例。如果您正苦于以下问题:Golang CreateSubnet.GatewayIP方法的具体用法?Golang CreateSubnet.GatewayIP怎么用?Golang CreateSubnet.GatewayIP使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/juju/gomaasapi.CreateSubnet
的用法示例。
在下文中一共展示了CreateSubnet.GatewayIP方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: createSubnet
func createSubnet(ipRange, spaceAndNICID uint) gomaasapi.CreateSubnet {
var s gomaasapi.CreateSubnet
s.DNSServers = []string{"192.168.1.2"}
s.Name = fmt.Sprintf("maas-eth%d", spaceAndNICID)
s.Space = fmt.Sprintf("Space %d", spaceAndNICID)
s.GatewayIP = fmt.Sprintf("192.168.%v.1", ipRange)
s.CIDR = fmt.Sprintf("192.168.%v.0/24", ipRange)
return s
}
示例2: newSubnet
func (s *instanceTest) newSubnet(cidr, space string, id uint) *bytes.Buffer {
var sub gomaasapi.CreateSubnet
sub.DNSServers = []string{"192.168.1.2"}
sub.Name = cidr
sub.Space = space
sub.GatewayIP = "192.168.1.1"
sub.CIDR = cidr
sub.ID = id
return s.subnetJSON(sub)
}
示例3: defaultSubnet
func defaultSubnet() gomaasapi.CreateSubnet {
var s gomaasapi.CreateSubnet
s.DNSServers = []string{"192.168.1.2"}
s.Name = "maas-eth0"
s.Space = "space-0"
s.GatewayIP = "192.168.1.1"
s.CIDR = "192.168.1.0/24"
s.ID = 1
return s
}