v0.2.2 9100209

gnetworkservice.go RawHistoryFolder

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
15type NetworkServiceClass struct {
16	_ structs.HostLayout
17
18	ParentClass gobject.ObjectClass
19}
20
21func (x *NetworkServiceClass) GoPointer() uintptr {
22	return uintptr(unsafe.Pointer(x))
23}
24
25type NetworkServicePrivate struct {
26	_ structs.HostLayout
27}
28
29func (x *NetworkServicePrivate) GoPointer() uintptr {
30	return uintptr(unsafe.Pointer(x))
31}
32
33// Like [class@Gio.NetworkAddress] does with hostnames, `GNetworkService`
34// provides an easy way to resolve a SRV record, and then attempt to
35// connect to one of the hosts that implements that service, handling
36// service priority/weighting, multiple IP addresses, and multiple
37// address families.
38//
39// See [struct@Gio.SrvTarget] for more information about SRV records, and see
40// [iface@Gio.SocketConnectable] for an example of using the connectable
41// interface.
42type NetworkService struct {
43	gobject.Object
44}
45
46var xNetworkServiceGLibType func() types.GType
47
48func NetworkServiceGLibType() types.GType {
49	return xNetworkServiceGLibType()
50}
51
52func NetworkServiceNewFromInternalPtr(ptr uintptr) *NetworkService {
53	cls := &NetworkService{}
54	cls.Ptr = ptr
55	return cls
56}
57
58var xNewNetworkService func(string, string, string) uintptr
59
60// Creates a new #GNetworkService representing the given @service,
61// @protocol, and @domain. This will initially be unresolved; use the
62// #GSocketConnectable interface to resolve it.
63func NewNetworkService(ServiceVar string, ProtocolVar string, DomainVar string) *NetworkService {
64	var cls *NetworkService
65
66	cret := xNewNetworkService(ServiceVar, ProtocolVar, DomainVar)
67
68	if cret == 0 {
69		return nil
70	}
71	cls = &NetworkService{}
72	cls.Ptr = cret
73	return cls
74}
75
76var xNetworkServiceGetDomain func(uintptr) string
77
78// Gets the domain that @srv serves. This might be either UTF-8 or
79// ASCII-encoded, depending on what @srv was created with.
80func (x *NetworkService) GetDomain() string {
81
82	cret := xNetworkServiceGetDomain(x.GoPointer())
83	return cret
84}
85
86var xNetworkServiceGetProtocol func(uintptr) string
87
88// Gets @srv's protocol name (eg, "tcp").
89func (x *NetworkService) GetProtocol() string {
90
91	cret := xNetworkServiceGetProtocol(x.GoPointer())
92	return cret
93}
94
95var xNetworkServiceGetScheme func(uintptr) string
96
97// Gets the URI scheme used to resolve proxies. By default, the service name
98// is used as scheme.
99func (x *NetworkService) GetScheme() string {
100
101	cret := xNetworkServiceGetScheme(x.GoPointer())
102	return cret
103}
104
105var xNetworkServiceGetService func(uintptr) string
106
107// Gets @srv's service name (eg, "ldap").
108func (x *NetworkService) GetService() string {
109
110	cret := xNetworkServiceGetService(x.GoPointer())
111	return cret
112}
113
114var xNetworkServiceSetScheme func(uintptr, string)
115
116// Set's the URI scheme used to resolve proxies. By default, the service name
117// is used as scheme.
118func (x *NetworkService) SetScheme(SchemeVar string) {
119
120	xNetworkServiceSetScheme(x.GoPointer(), SchemeVar)
121
122}
123
124func (c *NetworkService) GoPointer() uintptr {
125	if c == nil {
126		return 0
127	}
128	return c.Ptr
129}
130
131func (c *NetworkService) SetGoPointer(ptr uintptr) {
132	c.Ptr = ptr
133}
134
135// SetPropertyDomain sets the "domain" property.
136// Network domain, for example `example.com`.
137func (x *NetworkService) SetPropertyDomain(value string) {
138	var v gobject.Value
139	v.Init(gobject.TypeStringVal)
140	v.SetString(&value)
141	x.SetProperty("domain", &v)
142}
143
144// GetPropertyDomain gets the "domain" property.
145// Network domain, for example `example.com`.
146func (x *NetworkService) GetPropertyDomain() string {
147	var v gobject.Value
148	x.GetProperty("domain", &v)
149	return v.GetString()
150}
151
152// SetPropertyProtocol sets the "protocol" property.
153// Network protocol, for example `tcp`.
154func (x *NetworkService) SetPropertyProtocol(value string) {
155	var v gobject.Value
156	v.Init(gobject.TypeStringVal)
157	v.SetString(&value)
158	x.SetProperty("protocol", &v)
159}
160
161// GetPropertyProtocol gets the "protocol" property.
162// Network protocol, for example `tcp`.
163func (x *NetworkService) GetPropertyProtocol() string {
164	var v gobject.Value
165	x.GetProperty("protocol", &v)
166	return v.GetString()
167}
168
169// SetPropertyScheme sets the "scheme" property.
170// Network scheme (default is to use service).
171func (x *NetworkService) SetPropertyScheme(value string) {
172	var v gobject.Value
173	v.Init(gobject.TypeStringVal)
174	v.SetString(&value)
175	x.SetProperty("scheme", &v)
176}
177
178// GetPropertyScheme gets the "scheme" property.
179// Network scheme (default is to use service).
180func (x *NetworkService) GetPropertyScheme() string {
181	var v gobject.Value
182	x.GetProperty("scheme", &v)
183	return v.GetString()
184}
185
186// SetPropertyService sets the "service" property.
187// Service name, for example `ldap`.
188func (x *NetworkService) SetPropertyService(value string) {
189	var v gobject.Value
190	v.Init(gobject.TypeStringVal)
191	v.SetString(&value)
192	x.SetProperty("service", &v)
193}
194
195// GetPropertyService gets the "service" property.
196// Service name, for example `ldap`.
197func (x *NetworkService) GetPropertyService() string {
198	var v gobject.Value
199	x.GetProperty("service", &v)
200	return v.GetString()
201}
202
203// Creates a #GSocketAddressEnumerator for @connectable.
204func (x *NetworkService) Enumerate() *SocketAddressEnumerator {
205	var cls *SocketAddressEnumerator
206
207	cret := XGSocketConnectableEnumerate(x.GoPointer())
208
209	if cret == 0 {
210		return nil
211	}
212	cls = &SocketAddressEnumerator{}
213	cls.Ptr = cret
214	return cls
215}
216
217// Creates a #GSocketAddressEnumerator for @connectable that will
218// return a #GProxyAddress for each of its addresses that you must connect
219// to via a proxy.
220//
221// If @connectable does not implement
222// g_socket_connectable_proxy_enumerate(), this will fall back to
223// calling g_socket_connectable_enumerate().
224func (x *NetworkService) ProxyEnumerate() *SocketAddressEnumerator {
225	var cls *SocketAddressEnumerator
226
227	cret := XGSocketConnectableProxyEnumerate(x.GoPointer())
228
229	if cret == 0 {
230		return nil
231	}
232	cls = &SocketAddressEnumerator{}
233	cls.Ptr = cret
234	return cls
235}
236
237// Format a #GSocketConnectable as a string. This is a human-readable format for
238// use in debugging output, and is not a stable serialization format. It is not
239// suitable for use in user interfaces as it exposes too much information for a
240// user.
241//
242// If the #GSocketConnectable implementation does not support string formatting,
243// the implementation’s type name will be returned as a fallback.
244func (x *NetworkService) ToString() string {
245
246	cret := XGSocketConnectableToString(x.GoPointer())
247	return cret
248}
249
250func init() {
251	core.SetPackageName("GIO", "gio-2.0")
252	core.SetSharedLibraries("GIO", []string{"libgio-2.0.so.0"})
253	var libs []uintptr
254	for _, libPath := range core.GetPaths("GIO") {
255		lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL)
256		if err != nil {
257			panic(err)
258		}
259		libs = append(libs, lib)
260	}
261
262	core.PuregoSafeRegister(&xNetworkServiceGLibType, libs, "g_network_service_get_type")
263
264	core.PuregoSafeRegister(&xNewNetworkService, libs, "g_network_service_new")
265
266	core.PuregoSafeRegister(&xNetworkServiceGetDomain, libs, "g_network_service_get_domain")
267	core.PuregoSafeRegister(&xNetworkServiceGetProtocol, libs, "g_network_service_get_protocol")
268	core.PuregoSafeRegister(&xNetworkServiceGetScheme, libs, "g_network_service_get_scheme")
269	core.PuregoSafeRegister(&xNetworkServiceGetService, libs, "g_network_service_get_service")
270	core.PuregoSafeRegister(&xNetworkServiceSetScheme, libs, "g_network_service_set_scheme")
271
272}

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 1

Tags 102

↑↓ moveenter openesc close