예제 #1
0
파일: address.go 프로젝트: Pankov404/juju
// 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
0
파일: network.go 프로젝트: makyo/juju
// 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
0
파일: address.go 프로젝트: Pankov404/juju
// 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
0
파일: ipaddresses.go 프로젝트: imoapps/juju
// 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)
}