// 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/glib" "github.com/bnema/puregotk/v4/gobject" "github.com/bnema/puregotk/v4/gobject/types" ) // Provides an interface for #GTlsFileDatabase implementations. type TlsFileDatabaseInterface struct { _ structs.HostLayout GIface uintptr Padding [8]uintptr } func (x *TlsFileDatabaseInterface) GoPointer() uintptr { return uintptr(unsafe.Pointer(x)) } // `GTlsFileDatabase` is implemented by [class@Gio.TlsDatabase] objects which // load their certificate information from a file. It is an interface which // TLS library specific subtypes implement. type TlsFileDatabase interface { GoPointer() uintptr SetGoPointer(uintptr) } var xTlsFileDatabaseGLibType func() types.GType func TlsFileDatabaseGLibType() types.GType { return xTlsFileDatabaseGLibType() } type TlsFileDatabaseBase struct { Ptr uintptr } func (x *TlsFileDatabaseBase) GoPointer() uintptr { if x == nil { return 0 } return x.Ptr } func (x *TlsFileDatabaseBase) SetGoPointer(ptr uintptr) { x.Ptr = ptr } // SetPropertyAnchors sets the "anchors" property. // The path to a file containing PEM encoded certificate authority // root anchors. The certificates in this file will be treated as // root authorities for the purpose of verifying other certificates // via the g_tls_database_verify_chain() operation. func (x *TlsFileDatabaseBase) SetPropertyAnchors(value string) { obj := gobject.Object{} obj.Ptr = x.GoPointer() var v gobject.Value v.Init(gobject.TypeStringVal) v.SetString(&value) obj.SetProperty("anchors", &v) } // GetPropertyAnchors gets the "anchors" property. // The path to a file containing PEM encoded certificate authority // root anchors. The certificates in this file will be treated as // root authorities for the purpose of verifying other certificates // via the g_tls_database_verify_chain() operation. func (x *TlsFileDatabaseBase) GetPropertyAnchors() string { obj := gobject.Object{} obj.Ptr = x.GoPointer() var v gobject.Value obj.GetProperty("anchors", &v) return v.GetString() } var xTlsFileDatabaseNew func(string, **glib.Error) uintptr // Creates a new #GTlsFileDatabase which uses anchor certificate authorities // in @anchors to verify certificate chains. // // The certificates in @anchors must be PEM encoded. func TlsFileDatabaseNew(AnchorsVar string) (*TlsFileDatabaseBase, error) { var cls *TlsFileDatabaseBase var cerr *glib.Error cret := xTlsFileDatabaseNew(AnchorsVar, &cerr) if cret == 0 { return nil, cerr } cls = &TlsFileDatabaseBase{} cls.Ptr = cret if cerr == nil { return cls, nil } return cls, cerr } 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(&xTlsFileDatabaseNew, libs, "g_tls_file_database_new") core.PuregoSafeRegister(&xTlsFileDatabaseGLibType, libs, "g_tls_file_database_get_type") }