gtlsserverconnection.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/glib"
12 "github.com/bnema/puregotk/v4/gobject/types"
13)
14
15// vtable for a #GTlsServerConnection implementation.
16type TlsServerConnectionInterface struct {
17 _ structs.HostLayout
18
19 GIface uintptr
20}
21
22func (x *TlsServerConnectionInterface) GoPointer() uintptr {
23 return uintptr(unsafe.Pointer(x))
24}
25
26// `GTlsServerConnection` is the server-side subclass of
27// [class@Gio.TlsConnection], representing a server-side TLS connection.
28type TlsServerConnection interface {
29 GoPointer() uintptr
30 SetGoPointer(uintptr)
31}
32
33var xTlsServerConnectionGLibType func() types.GType
34
35func TlsServerConnectionGLibType() types.GType {
36 return xTlsServerConnectionGLibType()
37}
38
39type TlsServerConnectionBase struct {
40 Ptr uintptr
41}
42
43func (x *TlsServerConnectionBase) GoPointer() uintptr {
44 if x == nil {
45 return 0
46 }
47 return x.Ptr
48}
49
50func (x *TlsServerConnectionBase) SetGoPointer(ptr uintptr) {
51 x.Ptr = ptr
52}
53
54var xTlsServerConnectionNew func(uintptr, uintptr, **glib.Error) uintptr
55
56// Creates a new #GTlsServerConnection wrapping @base_io_stream (which
57// must have pollable input and output streams).
58//
59// See the documentation for #GTlsConnection:base-io-stream for restrictions
60// on when application code can run operations on the @base_io_stream after
61// this function has returned.
62func TlsServerConnectionNew(BaseIoStreamVar *IOStream, CertificateVar *TlsCertificate) (*TlsServerConnectionBase, error) {
63 var cls *TlsServerConnectionBase
64 var cerr *glib.Error
65
66 cret := xTlsServerConnectionNew(BaseIoStreamVar.GoPointer(), CertificateVar.GoPointer(), &cerr)
67
68 if cret == 0 {
69 return nil, cerr
70 }
71 cls = &TlsServerConnectionBase{}
72 cls.Ptr = cret
73 if cerr == nil {
74 return cls, nil
75 }
76 return cls, cerr
77
78}
79
80func init() {
81 core.SetPackageName("GIO", "gio-2.0")
82 core.SetSharedLibraries("GIO", []string{"libgio-2.0.so.0"})
83 var libs []uintptr
84 for _, libPath := range core.GetPaths("GIO") {
85 lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL)
86 if err != nil {
87 panic(err)
88 }
89 libs = append(libs, lib)
90 }
91
92 core.PuregoSafeRegister(&xTlsServerConnectionNew, libs, "g_tls_server_connection_new")
93
94 core.PuregoSafeRegister(&xTlsServerConnectionGLibType, libs, "g_tls_server_connection_get_type")
95
96}