1// Package gio was automatically generated by github.com/bnema/puregotk DO NOT EDIT
2package gio
3
4import (
5 "structs"
6 "unsafe"
7
8 "github.com/ebitengine/purego"
9
10 "github.com/bnema/puregotk/pkg/core"
11 "github.com/bnema/puregotk/v4/gobject"
12 "github.com/bnema/puregotk/v4/gobject/types"
13)
14
15// Class structure for #GProxyAddress.
16type ProxyAddressClass struct {
17 _ structs.HostLayout
18
19 ParentClass InetSocketAddressClass
20}
21
22func (x *ProxyAddressClass) GoPointer() uintptr {
23 return uintptr(unsafe.Pointer(x))
24}
25
26type ProxyAddressPrivate struct {
27 _ structs.HostLayout
28}
29
30func (x *ProxyAddressPrivate) GoPointer() uintptr {
31 return uintptr(unsafe.Pointer(x))
32}
33
34// A [class@Gio.InetSocketAddress] representing a connection via a proxy server.
35type ProxyAddress struct {
36 InetSocketAddress
37}
38
39var xProxyAddressGLibType func() types.GType
40
41func ProxyAddressGLibType() types.GType {
42 return xProxyAddressGLibType()
43}
44
45func ProxyAddressNewFromInternalPtr(ptr uintptr) *ProxyAddress {
46 cls := &ProxyAddress{}
47 cls.Ptr = ptr
48 return cls
49}
50
51var xNewProxyAddress func(uintptr, uint16, string, string, uint16, uintptr, uintptr) uintptr
52
53// Creates a new #GProxyAddress for @inetaddr with @protocol that should
54// tunnel through @dest_hostname and @dest_port.
55//
56// (Note that this method doesn't set the #GProxyAddress:uri or
57// #GProxyAddress:destination-protocol fields; use g_object_new()
58// directly if you want to set those.)
59func NewProxyAddress(InetaddrVar *InetAddress, PortVar uint16, ProtocolVar string, DestHostnameVar string, DestPortVar uint16, UsernameVar *string, PasswordVar *string) *ProxyAddress {
60 var cls *ProxyAddress
61
62 UsernameVarPtr := core.GStrdupNullable(UsernameVar)
63 defer core.GFreeNullable(UsernameVarPtr)
64
65 PasswordVarPtr := core.GStrdupNullable(PasswordVar)
66 defer core.GFreeNullable(PasswordVarPtr)
67
68 cret := xNewProxyAddress(InetaddrVar.GoPointer(), PortVar, ProtocolVar, DestHostnameVar, DestPortVar, UsernameVarPtr, PasswordVarPtr)
69
70 if cret == 0 {
71 return nil
72 }
73 cls = &ProxyAddress{}
74 cls.Ptr = cret
75 return cls
76}
77
78var xProxyAddressGetDestinationHostname func(uintptr) string
79
80// Gets @proxy's destination hostname; that is, the name of the host
81// that will be connected to via the proxy, not the name of the proxy
82// itself.
83func (x *ProxyAddress) GetDestinationHostname() string {
84
85 cret := xProxyAddressGetDestinationHostname(x.GoPointer())
86 return cret
87}
88
89var xProxyAddressGetDestinationPort func(uintptr) uint16
90
91// Gets @proxy's destination port; that is, the port on the
92// destination host that will be connected to via the proxy, not the
93// port number of the proxy itself.
94func (x *ProxyAddress) GetDestinationPort() uint16 {
95
96 cret := xProxyAddressGetDestinationPort(x.GoPointer())
97 return cret
98}
99
100var xProxyAddressGetDestinationProtocol func(uintptr) string
101
102// Gets the protocol that is being spoken to the destination
103// server; eg, "http" or "ftp".
104func (x *ProxyAddress) GetDestinationProtocol() string {
105
106 cret := xProxyAddressGetDestinationProtocol(x.GoPointer())
107 return cret
108}
109
110var xProxyAddressGetPassword func(uintptr) string
111
112// Gets @proxy's password.
113func (x *ProxyAddress) GetPassword() string {
114
115 cret := xProxyAddressGetPassword(x.GoPointer())
116 return cret
117}
118
119var xProxyAddressGetProtocol func(uintptr) string
120
121// Gets @proxy's protocol. eg, "socks" or "http"
122func (x *ProxyAddress) GetProtocol() string {
123
124 cret := xProxyAddressGetProtocol(x.GoPointer())
125 return cret
126}
127
128var xProxyAddressGetUri func(uintptr) string
129
130// Gets the proxy URI that @proxy was constructed from.
131func (x *ProxyAddress) GetUri() string {
132
133 cret := xProxyAddressGetUri(x.GoPointer())
134 return cret
135}
136
137var xProxyAddressGetUsername func(uintptr) string
138
139// Gets @proxy's username.
140func (x *ProxyAddress) GetUsername() string {
141
142 cret := xProxyAddressGetUsername(x.GoPointer())
143 return cret
144}
145
146func (c *ProxyAddress) GoPointer() uintptr {
147 if c == nil {
148 return 0
149 }
150 return c.Ptr
151}
152
153func (c *ProxyAddress) SetGoPointer(ptr uintptr) {
154 c.Ptr = ptr
155}
156
157// SetPropertyDestinationHostname sets the "destination-hostname" property.
158// The proxy destination hostname.
159func (x *ProxyAddress) SetPropertyDestinationHostname(value string) {
160 var v gobject.Value
161 v.Init(gobject.TypeStringVal)
162 v.SetString(&value)
163 x.SetProperty("destination-hostname", &v)
164}
165
166// GetPropertyDestinationHostname gets the "destination-hostname" property.
167// The proxy destination hostname.
168func (x *ProxyAddress) GetPropertyDestinationHostname() string {
169 var v gobject.Value
170 x.GetProperty("destination-hostname", &v)
171 return v.GetString()
172}
173
174// SetPropertyDestinationPort sets the "destination-port" property.
175// The proxy destination port.
176func (x *ProxyAddress) SetPropertyDestinationPort(value uint) {
177 var v gobject.Value
178 v.Init(gobject.TypeUintVal)
179 v.SetUint(value)
180 x.SetProperty("destination-port", &v)
181}
182
183// GetPropertyDestinationPort gets the "destination-port" property.
184// The proxy destination port.
185func (x *ProxyAddress) GetPropertyDestinationPort() uint {
186 var v gobject.Value
187 x.GetProperty("destination-port", &v)
188 return v.GetUint()
189}
190
191// SetPropertyDestinationProtocol sets the "destination-protocol" property.
192// The protocol being spoke to the destination host, or %NULL if
193// the #GProxyAddress doesn't know.
194func (x *ProxyAddress) SetPropertyDestinationProtocol(value string) {
195 var v gobject.Value
196 v.Init(gobject.TypeStringVal)
197 v.SetString(&value)
198 x.SetProperty("destination-protocol", &v)
199}
200
201// GetPropertyDestinationProtocol gets the "destination-protocol" property.
202// The protocol being spoke to the destination host, or %NULL if
203// the #GProxyAddress doesn't know.
204func (x *ProxyAddress) GetPropertyDestinationProtocol() string {
205 var v gobject.Value
206 x.GetProperty("destination-protocol", &v)
207 return v.GetString()
208}
209
210// SetPropertyPassword sets the "password" property.
211// The proxy password.
212func (x *ProxyAddress) SetPropertyPassword(value string) {
213 var v gobject.Value
214 v.Init(gobject.TypeStringVal)
215 v.SetString(&value)
216 x.SetProperty("password", &v)
217}
218
219// GetPropertyPassword gets the "password" property.
220// The proxy password.
221func (x *ProxyAddress) GetPropertyPassword() string {
222 var v gobject.Value
223 x.GetProperty("password", &v)
224 return v.GetString()
225}
226
227// SetPropertyProtocol sets the "protocol" property.
228// The proxy protocol.
229func (x *ProxyAddress) SetPropertyProtocol(value string) {
230 var v gobject.Value
231 v.Init(gobject.TypeStringVal)
232 v.SetString(&value)
233 x.SetProperty("protocol", &v)
234}
235
236// GetPropertyProtocol gets the "protocol" property.
237// The proxy protocol.
238func (x *ProxyAddress) GetPropertyProtocol() string {
239 var v gobject.Value
240 x.GetProperty("protocol", &v)
241 return v.GetString()
242}
243
244// SetPropertyUri sets the "uri" property.
245// The URI string that the proxy was constructed from (or %NULL
246// if the creator didn't specify this).
247func (x *ProxyAddress) SetPropertyUri(value string) {
248 var v gobject.Value
249 v.Init(gobject.TypeStringVal)
250 v.SetString(&value)
251 x.SetProperty("uri", &v)
252}
253
254// GetPropertyUri gets the "uri" property.
255// The URI string that the proxy was constructed from (or %NULL
256// if the creator didn't specify this).
257func (x *ProxyAddress) GetPropertyUri() string {
258 var v gobject.Value
259 x.GetProperty("uri", &v)
260 return v.GetString()
261}
262
263// SetPropertyUsername sets the "username" property.
264// The proxy username.
265func (x *ProxyAddress) SetPropertyUsername(value string) {
266 var v gobject.Value
267 v.Init(gobject.TypeStringVal)
268 v.SetString(&value)
269 x.SetProperty("username", &v)
270}
271
272// GetPropertyUsername gets the "username" property.
273// The proxy username.
274func (x *ProxyAddress) GetPropertyUsername() string {
275 var v gobject.Value
276 x.GetProperty("username", &v)
277 return v.GetString()
278}
279
280// Creates a #GSocketAddressEnumerator for @connectable.
281func (x *ProxyAddress) Enumerate() *SocketAddressEnumerator {
282 var cls *SocketAddressEnumerator
283
284 cret := XGSocketConnectableEnumerate(x.GoPointer())
285
286 if cret == 0 {
287 return nil
288 }
289 cls = &SocketAddressEnumerator{}
290 cls.Ptr = cret
291 return cls
292}
293
294// Creates a #GSocketAddressEnumerator for @connectable that will
295// return a #GProxyAddress for each of its addresses that you must connect
296// to via a proxy.
297//
298// If @connectable does not implement
299// g_socket_connectable_proxy_enumerate(), this will fall back to
300// calling g_socket_connectable_enumerate().
301func (x *ProxyAddress) ProxyEnumerate() *SocketAddressEnumerator {
302 var cls *SocketAddressEnumerator
303
304 cret := XGSocketConnectableProxyEnumerate(x.GoPointer())
305
306 if cret == 0 {
307 return nil
308 }
309 cls = &SocketAddressEnumerator{}
310 cls.Ptr = cret
311 return cls
312}
313
314// Format a #GSocketConnectable as a string. This is a human-readable format for
315// use in debugging output, and is not a stable serialization format. It is not
316// suitable for use in user interfaces as it exposes too much information for a
317// user.
318//
319// If the #GSocketConnectable implementation does not support string formatting,
320// the implementation’s type name will be returned as a fallback.
321func (x *ProxyAddress) ToString() string {
322
323 cret := XGSocketConnectableToString(x.GoPointer())
324 return cret
325}
326
327func init() {
328 core.SetPackageName("GIO", "gio-2.0")
329 core.SetSharedLibraries("GIO", []string{"libgio-2.0.so.0"})
330 var libs []uintptr
331 for _, libPath := range core.GetPaths("GIO") {
332 lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL)
333 if err != nil {
334 panic(err)
335 }
336 libs = append(libs, lib)
337 }
338
339 core.PuregoSafeRegister(&xProxyAddressGLibType, libs, "g_proxy_address_get_type")
340
341 core.PuregoSafeRegister(&xNewProxyAddress, libs, "g_proxy_address_new")
342
343 core.PuregoSafeRegister(&xProxyAddressGetDestinationHostname, libs, "g_proxy_address_get_destination_hostname")
344 core.PuregoSafeRegister(&xProxyAddressGetDestinationPort, libs, "g_proxy_address_get_destination_port")
345 core.PuregoSafeRegister(&xProxyAddressGetDestinationProtocol, libs, "g_proxy_address_get_destination_protocol")
346 core.PuregoSafeRegister(&xProxyAddressGetPassword, libs, "g_proxy_address_get_password")
347 core.PuregoSafeRegister(&xProxyAddressGetProtocol, libs, "g_proxy_address_get_protocol")
348 core.PuregoSafeRegister(&xProxyAddressGetUri, libs, "g_proxy_address_get_uri")
349 core.PuregoSafeRegister(&xProxyAddressGetUsername, libs, "g_proxy_address_get_username")
350
351}