// Package gio was automatically generated by github.com/bnema/puregotk DO NOT EDIT package gio import ( "structs" "unsafe" "github.com/ebitengine/purego" "github.com/bnema/puregotk/pkg/core" "github.com/bnema/puregotk/v4/gobject" "github.com/bnema/puregotk/v4/gobject/types" ) // Class structure for #GProxyAddress. type ProxyAddressClass struct { _ structs.HostLayout ParentClass InetSocketAddressClass } func (x *ProxyAddressClass) GoPointer() uintptr { return uintptr(unsafe.Pointer(x)) } type ProxyAddressPrivate struct { _ structs.HostLayout } func (x *ProxyAddressPrivate) GoPointer() uintptr { return uintptr(unsafe.Pointer(x)) } // A [class@Gio.InetSocketAddress] representing a connection via a proxy server. type ProxyAddress struct { InetSocketAddress } var xProxyAddressGLibType func() types.GType func ProxyAddressGLibType() types.GType { return xProxyAddressGLibType() } func ProxyAddressNewFromInternalPtr(ptr uintptr) *ProxyAddress { cls := &ProxyAddress{} cls.Ptr = ptr return cls } var xNewProxyAddress func(uintptr, uint16, string, string, uint16, uintptr, uintptr) uintptr // Creates a new #GProxyAddress for @inetaddr with @protocol that should // tunnel through @dest_hostname and @dest_port. // // (Note that this method doesn't set the #GProxyAddress:uri or // #GProxyAddress:destination-protocol fields; use g_object_new() // directly if you want to set those.) func NewProxyAddress(InetaddrVar *InetAddress, PortVar uint16, ProtocolVar string, DestHostnameVar string, DestPortVar uint16, UsernameVar *string, PasswordVar *string) *ProxyAddress { var cls *ProxyAddress UsernameVarPtr := core.GStrdupNullable(UsernameVar) defer core.GFreeNullable(UsernameVarPtr) PasswordVarPtr := core.GStrdupNullable(PasswordVar) defer core.GFreeNullable(PasswordVarPtr) cret := xNewProxyAddress(InetaddrVar.GoPointer(), PortVar, ProtocolVar, DestHostnameVar, DestPortVar, UsernameVarPtr, PasswordVarPtr) if cret == 0 { return nil } cls = &ProxyAddress{} cls.Ptr = cret return cls } var xProxyAddressGetDestinationHostname func(uintptr) string // Gets @proxy's destination hostname; that is, the name of the host // that will be connected to via the proxy, not the name of the proxy // itself. func (x *ProxyAddress) GetDestinationHostname() string { cret := xProxyAddressGetDestinationHostname(x.GoPointer()) return cret } var xProxyAddressGetDestinationPort func(uintptr) uint16 // Gets @proxy's destination port; that is, the port on the // destination host that will be connected to via the proxy, not the // port number of the proxy itself. func (x *ProxyAddress) GetDestinationPort() uint16 { cret := xProxyAddressGetDestinationPort(x.GoPointer()) return cret } var xProxyAddressGetDestinationProtocol func(uintptr) string // Gets the protocol that is being spoken to the destination // server; eg, "http" or "ftp". func (x *ProxyAddress) GetDestinationProtocol() string { cret := xProxyAddressGetDestinationProtocol(x.GoPointer()) return cret } var xProxyAddressGetPassword func(uintptr) string // Gets @proxy's password. func (x *ProxyAddress) GetPassword() string { cret := xProxyAddressGetPassword(x.GoPointer()) return cret } var xProxyAddressGetProtocol func(uintptr) string // Gets @proxy's protocol. eg, "socks" or "http" func (x *ProxyAddress) GetProtocol() string { cret := xProxyAddressGetProtocol(x.GoPointer()) return cret } var xProxyAddressGetUri func(uintptr) string // Gets the proxy URI that @proxy was constructed from. func (x *ProxyAddress) GetUri() string { cret := xProxyAddressGetUri(x.GoPointer()) return cret } var xProxyAddressGetUsername func(uintptr) string // Gets @proxy's username. func (x *ProxyAddress) GetUsername() string { cret := xProxyAddressGetUsername(x.GoPointer()) return cret } func (c *ProxyAddress) GoPointer() uintptr { if c == nil { return 0 } return c.Ptr } func (c *ProxyAddress) SetGoPointer(ptr uintptr) { c.Ptr = ptr } // SetPropertyDestinationHostname sets the "destination-hostname" property. // The proxy destination hostname. func (x *ProxyAddress) SetPropertyDestinationHostname(value string) { var v gobject.Value v.Init(gobject.TypeStringVal) v.SetString(&value) x.SetProperty("destination-hostname", &v) } // GetPropertyDestinationHostname gets the "destination-hostname" property. // The proxy destination hostname. func (x *ProxyAddress) GetPropertyDestinationHostname() string { var v gobject.Value x.GetProperty("destination-hostname", &v) return v.GetString() } // SetPropertyDestinationPort sets the "destination-port" property. // The proxy destination port. func (x *ProxyAddress) SetPropertyDestinationPort(value uint) { var v gobject.Value v.Init(gobject.TypeUintVal) v.SetUint(value) x.SetProperty("destination-port", &v) } // GetPropertyDestinationPort gets the "destination-port" property. // The proxy destination port. func (x *ProxyAddress) GetPropertyDestinationPort() uint { var v gobject.Value x.GetProperty("destination-port", &v) return v.GetUint() } // SetPropertyDestinationProtocol sets the "destination-protocol" property. // The protocol being spoke to the destination host, or %NULL if // the #GProxyAddress doesn't know. func (x *ProxyAddress) SetPropertyDestinationProtocol(value string) { var v gobject.Value v.Init(gobject.TypeStringVal) v.SetString(&value) x.SetProperty("destination-protocol", &v) } // GetPropertyDestinationProtocol gets the "destination-protocol" property. // The protocol being spoke to the destination host, or %NULL if // the #GProxyAddress doesn't know. func (x *ProxyAddress) GetPropertyDestinationProtocol() string { var v gobject.Value x.GetProperty("destination-protocol", &v) return v.GetString() } // SetPropertyPassword sets the "password" property. // The proxy password. func (x *ProxyAddress) SetPropertyPassword(value string) { var v gobject.Value v.Init(gobject.TypeStringVal) v.SetString(&value) x.SetProperty("password", &v) } // GetPropertyPassword gets the "password" property. // The proxy password. func (x *ProxyAddress) GetPropertyPassword() string { var v gobject.Value x.GetProperty("password", &v) return v.GetString() } // SetPropertyProtocol sets the "protocol" property. // The proxy protocol. func (x *ProxyAddress) SetPropertyProtocol(value string) { var v gobject.Value v.Init(gobject.TypeStringVal) v.SetString(&value) x.SetProperty("protocol", &v) } // GetPropertyProtocol gets the "protocol" property. // The proxy protocol. func (x *ProxyAddress) GetPropertyProtocol() string { var v gobject.Value x.GetProperty("protocol", &v) return v.GetString() } // SetPropertyUri sets the "uri" property. // The URI string that the proxy was constructed from (or %NULL // if the creator didn't specify this). func (x *ProxyAddress) SetPropertyUri(value string) { var v gobject.Value v.Init(gobject.TypeStringVal) v.SetString(&value) x.SetProperty("uri", &v) } // GetPropertyUri gets the "uri" property. // The URI string that the proxy was constructed from (or %NULL // if the creator didn't specify this). func (x *ProxyAddress) GetPropertyUri() string { var v gobject.Value x.GetProperty("uri", &v) return v.GetString() } // SetPropertyUsername sets the "username" property. // The proxy username. func (x *ProxyAddress) SetPropertyUsername(value string) { var v gobject.Value v.Init(gobject.TypeStringVal) v.SetString(&value) x.SetProperty("username", &v) } // GetPropertyUsername gets the "username" property. // The proxy username. func (x *ProxyAddress) GetPropertyUsername() string { var v gobject.Value x.GetProperty("username", &v) return v.GetString() } // Creates a #GSocketAddressEnumerator for @connectable. func (x *ProxyAddress) Enumerate() *SocketAddressEnumerator { var cls *SocketAddressEnumerator cret := XGSocketConnectableEnumerate(x.GoPointer()) if cret == 0 { return nil } cls = &SocketAddressEnumerator{} cls.Ptr = cret return cls } // Creates a #GSocketAddressEnumerator for @connectable that will // return a #GProxyAddress for each of its addresses that you must connect // to via a proxy. // // If @connectable does not implement // g_socket_connectable_proxy_enumerate(), this will fall back to // calling g_socket_connectable_enumerate(). func (x *ProxyAddress) ProxyEnumerate() *SocketAddressEnumerator { var cls *SocketAddressEnumerator cret := XGSocketConnectableProxyEnumerate(x.GoPointer()) if cret == 0 { return nil } cls = &SocketAddressEnumerator{} cls.Ptr = cret return cls } // Format a #GSocketConnectable as a string. This is a human-readable format for // use in debugging output, and is not a stable serialization format. It is not // suitable for use in user interfaces as it exposes too much information for a // user. // // If the #GSocketConnectable implementation does not support string formatting, // the implementation’s type name will be returned as a fallback. func (x *ProxyAddress) ToString() string { cret := XGSocketConnectableToString(x.GoPointer()) return cret } func init() { core.SetPackageName("GIO", "gio-2.0") core.SetSharedLibraries("GIO", []string{"libgio-2.0.so.0"}) var libs []uintptr for _, libPath := range core.GetPaths("GIO") { lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL) if err != nil { panic(err) } libs = append(libs, lib) } core.PuregoSafeRegister(&xProxyAddressGLibType, libs, "g_proxy_address_get_type") core.PuregoSafeRegister(&xNewProxyAddress, libs, "g_proxy_address_new") core.PuregoSafeRegister(&xProxyAddressGetDestinationHostname, libs, "g_proxy_address_get_destination_hostname") core.PuregoSafeRegister(&xProxyAddressGetDestinationPort, libs, "g_proxy_address_get_destination_port") core.PuregoSafeRegister(&xProxyAddressGetDestinationProtocol, libs, "g_proxy_address_get_destination_protocol") core.PuregoSafeRegister(&xProxyAddressGetPassword, libs, "g_proxy_address_get_password") core.PuregoSafeRegister(&xProxyAddressGetProtocol, libs, "g_proxy_address_get_protocol") core.PuregoSafeRegister(&xProxyAddressGetUri, libs, "g_proxy_address_get_uri") core.PuregoSafeRegister(&xProxyAddressGetUsername, libs, "g_proxy_address_get_username") }