當前位置: 首頁>>代碼示例>>Golang>>正文


Golang network.Scope函數代碼示例

本文整理匯總了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),
	}
}
開發者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: 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)
}
開發者ID:imoapps,項目名稱:juju,代碼行數:5,代碼來源:ipaddresses.go


注:本文中的github.com/juju/juju/network.Scope函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。