当前位置: 首页>>代码示例>>Golang>>正文


Golang network.AddressType函数代码示例

本文整理汇总了Golang中github.com/juju/juju/network.AddressType函数的典型用法代码示例。如果您正苦于以下问题:Golang AddressType函数的具体用法?Golang AddressType怎么用?Golang AddressType使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了AddressType函数的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),
	}
}
开发者ID:Pankov404,项目名称:juju,代码行数:10,代码来源:address.go

示例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),
	}
}
开发者ID:makyo,项目名称:juju,代码行数:10,代码来源:network.go

示例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,
	}
}
开发者ID:Pankov404,项目名称:juju,代码行数:13,代码来源:address.go

示例4: Type

// Type returns the type of the IP address. The IP address will have a type of
// IPv4, IPv6 or hostname.
func (i *IPAddress) Type() network.AddressType {
	return network.AddressType(i.doc.Type)
}
开发者ID:imoapps,项目名称:juju,代码行数:5,代码来源:ipaddresses.go


注:本文中的github.com/juju/juju/network.AddressType函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。