本文整理汇总了Golang中github.com/juju/juju/network.Scope函数的典型用法代码示例。如果您正苦于以下问题:Golang Scope函数的具体用法?Golang Scope怎么用?Golang Scope使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了Scope函数的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: networkAddress
// networkAddress is a convenience helper to return the state type
// as network type, here for Address.
func (addr *address) networkAddress() network.Address {
return network.Address{
Value: addr.Value,
Type: network.AddressType(addr.AddressType),
NetworkName: addr.NetworkName,
Scope: network.Scope(addr.Scope),
}
}
示例2: NetworkAddress
// NetworkAddress is a convenience helper to return the parameter
// as network type, here for Address.
func (addr Address) NetworkAddress() network.Address {
return network.Address{
Value: addr.Value,
Type: network.AddressType(addr.Type),
Scope: network.Scope(addr.Scope),
SpaceName: network.SpaceName(addr.SpaceName),
}
}
示例3: networkHostPort
// networkHostPort is a convenience helper to return the state type
// as network type, here for HostPort.
func (hp *hostPort) networkHostPort() network.HostPort {
return network.HostPort{
Address: network.Address{
Value: hp.Value,
Type: network.AddressType(hp.AddressType),
NetworkName: hp.NetworkName,
Scope: network.Scope(hp.Scope),
},
Port: hp.Port,
}
}
示例4: Scope
// Scope returns the scope of the IP address. If the scope is not set this
// returns "".
func (i *IPAddress) Scope() network.Scope {
return network.Scope(i.doc.Scope)
}