| Copyright | Will Thompson Iñaki García Etxebarria and Jonas Platte |
|---|---|
| License | LGPL-2.1 |
| Maintainer | Iñaki García Etxebarria (inaki@blueleaf.cc) |
| Safe Haskell | None |
| Language | Haskell2010 |
GI.Gio.Objects.NetworkService
Contents
Description
Like NetworkAddress does with hostnames, NetworkService
provides an easy way to resolve a SRV record, and then attempt to
connect to one of the hosts that implements that service, handling
service priority/weighting, multiple IP addresses, and multiple
address families.
See SrvTarget for more information about SRV records, and see
SocketConnectable for an example of using the connectable
interface.
Synopsis
- newtype NetworkService = NetworkService (ManagedPtr NetworkService)
- class (GObject o, IsDescendantOf NetworkService o) => IsNetworkService o
- toNetworkService :: (MonadIO m, IsNetworkService o) => o -> m NetworkService
- noNetworkService :: Maybe NetworkService
- networkServiceGetDomain :: (HasCallStack, MonadIO m, IsNetworkService a) => a -> m Text
- networkServiceGetProtocol :: (HasCallStack, MonadIO m, IsNetworkService a) => a -> m Text
- networkServiceGetScheme :: (HasCallStack, MonadIO m, IsNetworkService a) => a -> m Text
- networkServiceGetService :: (HasCallStack, MonadIO m, IsNetworkService a) => a -> m Text
- networkServiceNew :: (HasCallStack, MonadIO m) => Text -> Text -> Text -> m NetworkService
- networkServiceSetScheme :: (HasCallStack, MonadIO m, IsNetworkService a) => a -> Text -> m ()
- constructNetworkServiceDomain :: IsNetworkService o => Text -> IO (GValueConstruct o)
- getNetworkServiceDomain :: (MonadIO m, IsNetworkService o) => o -> m Text
- constructNetworkServiceProtocol :: IsNetworkService o => Text -> IO (GValueConstruct o)
- getNetworkServiceProtocol :: (MonadIO m, IsNetworkService o) => o -> m Text
- constructNetworkServiceScheme :: IsNetworkService o => Text -> IO (GValueConstruct o)
- getNetworkServiceScheme :: (MonadIO m, IsNetworkService o) => o -> m Text
- setNetworkServiceScheme :: (MonadIO m, IsNetworkService o) => o -> Text -> m ()
- constructNetworkServiceService :: IsNetworkService o => Text -> IO (GValueConstruct o)
- getNetworkServiceService :: (MonadIO m, IsNetworkService o) => o -> m Text
Exported types
newtype NetworkService Source #
Memory-managed wrapper type.
Constructors
| NetworkService (ManagedPtr NetworkService) |
Instances
| GObject NetworkService Source # | |
Defined in GI.Gio.Objects.NetworkService Methods gobjectType :: IO GType # | |
| HasParentTypes NetworkService Source # | |
Defined in GI.Gio.Objects.NetworkService | |
| type ParentTypes NetworkService Source # | |
Defined in GI.Gio.Objects.NetworkService | |
class (GObject o, IsDescendantOf NetworkService o) => IsNetworkService o Source #
Type class for types which can be safely cast to NetworkService, for instance with toNetworkService.
Instances
| (GObject o, IsDescendantOf NetworkService o) => IsNetworkService o Source # | |
Defined in GI.Gio.Objects.NetworkService | |
toNetworkService :: (MonadIO m, IsNetworkService o) => o -> m NetworkService Source #
Cast to NetworkService, for types for which this is known to be safe. For general casts, use castTo.
noNetworkService :: Maybe NetworkService Source #
A convenience alias for Nothing :: Maybe NetworkService.
Methods
getDomain
networkServiceGetDomain Source #
Arguments
| :: (HasCallStack, MonadIO m, IsNetworkService a) | |
| => a |
|
| -> m Text | Returns: |
Gets the domain that srv serves. This might be either UTF-8 or
ASCII-encoded, depending on what srv was created with.
Since: 2.22
getProtocol
networkServiceGetProtocol Source #
Arguments
| :: (HasCallStack, MonadIO m, IsNetworkService a) | |
| => a |
|
| -> m Text | Returns: |
Gets srv's protocol name (eg, "tcp").
Since: 2.22
getScheme
networkServiceGetScheme Source #
Arguments
| :: (HasCallStack, MonadIO m, IsNetworkService a) | |
| => a |
|
| -> m Text | Returns: |
Get's the URI scheme used to resolve proxies. By default, the service name is used as scheme.
Since: 2.26
getService
networkServiceGetService Source #
Arguments
| :: (HasCallStack, MonadIO m, IsNetworkService a) | |
| => a |
|
| -> m Text | Returns: |
Gets srv's service name (eg, "ldap").
Since: 2.22
new
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Text |
|
| -> Text |
|
| -> Text |
|
| -> m NetworkService | Returns: a new |
Creates a new NetworkService representing the given service,
protocol, and domain. This will initially be unresolved; use the
SocketConnectable interface to resolve it.
Since: 2.22
setScheme
networkServiceSetScheme Source #
Arguments
| :: (HasCallStack, MonadIO m, IsNetworkService a) | |
| => a |
|
| -> Text |
|
| -> m () |
Set's the URI scheme used to resolve proxies. By default, the service name is used as scheme.
Since: 2.26
Properties
domain
No description available in the introspection data.
constructNetworkServiceDomain :: IsNetworkService o => Text -> IO (GValueConstruct o) Source #
Construct a GValueConstruct with valid value for the “domain” property. This is rarely needed directly, but it is used by new.
getNetworkServiceDomain :: (MonadIO m, IsNetworkService o) => o -> m Text Source #
Get the value of the “domain” property.
When overloading is enabled, this is equivalent to
get networkService #domain
protocol
No description available in the introspection data.
constructNetworkServiceProtocol :: IsNetworkService o => Text -> IO (GValueConstruct o) Source #
Construct a GValueConstruct with valid value for the “protocol” property. This is rarely needed directly, but it is used by new.
getNetworkServiceProtocol :: (MonadIO m, IsNetworkService o) => o -> m Text Source #
Get the value of the “protocol” property.
When overloading is enabled, this is equivalent to
get networkService #protocol
scheme
No description available in the introspection data.
constructNetworkServiceScheme :: IsNetworkService o => Text -> IO (GValueConstruct o) Source #
Construct a GValueConstruct with valid value for the “scheme” property. This is rarely needed directly, but it is used by new.
getNetworkServiceScheme :: (MonadIO m, IsNetworkService o) => o -> m Text Source #
Get the value of the “scheme” property.
When overloading is enabled, this is equivalent to
get networkService #scheme
setNetworkServiceScheme :: (MonadIO m, IsNetworkService o) => o -> Text -> m () Source #
Set the value of the “scheme” property.
When overloading is enabled, this is equivalent to
setnetworkService [ #scheme:=value ]
service
No description available in the introspection data.
constructNetworkServiceService :: IsNetworkService o => Text -> IO (GValueConstruct o) Source #
Construct a GValueConstruct with valid value for the “service” property. This is rarely needed directly, but it is used by new.
getNetworkServiceService :: (MonadIO m, IsNetworkService o) => o -> m Text Source #
Get the value of the “service” property.
When overloading is enabled, this is equivalent to
get networkService #service