// 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), } }
// 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), } }
// 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, } }
// 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) }