Marshalls

package
v0.0.0-...-357ca8a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 20, 2025 License: MIT Imports: 24 Imported by: 0

Documentation

Overview

Provides data transformation and encoding utility functions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Advanced

func Advanced() class

Advanced exposes a 1:1 low-level instance of the class, undocumented, for those who know what they are doing.

func Base64ToRaw

func Base64ToRaw(base64_str string) []byte

Returns a decoded []byte corresponding to the Base64-encoded string 'base64_str'.

func Base64ToUtf8

func Base64ToUtf8(base64_str string) string

Returns a decoded string corresponding to the Base64-encoded string 'base64_str'.

func Base64ToVariant

func Base64ToVariant(base64_str string, allow_objects bool) any

Returns a decoded any corresponding to the Base64-encoded string 'base64_str'. If 'allow_objects' is true, decoding objects is allowed.

Internally, this uses the same decoding mechanism as the @GlobalScope.BytesToVar method.

Warning: Deserialized objects can contain code which gets executed. Do not use this option if the serialized object comes from untrusted sources to avoid potential security threats such as remote code execution.

func RawToBase64

func RawToBase64(array []byte) string

Returns a Base64-encoded string of a given []byte.

func Utf8ToBase64

func Utf8ToBase64(utf8_str string) string

Returns a Base64-encoded string of the UTF-8 string 'utf8_str'.

func VariantToBase64

func VariantToBase64(v any, full_objects bool) string

Returns a Base64-encoded string of the any 'variant'. If 'full_objects' is true, encoding objects is allowed (and can potentially include code).

Internally, this uses the same encoding mechanism as the @GlobalScope.VarToBytes method.

Types

type Extension

type Extension[T gdclass.Interface] struct{ gdclass.Extension[T, Instance] }

Extension can be embedded in a new struct to create an extension of this class. T should be the type that is embedding this Extension

func (*Extension[T]) AsObject

func (self *Extension[T]) AsObject() [1]gd.Object

type ID

type ID Object.ID

ID is a typed object ID (reference) to an instance of this class, use it to store references to objects with unknown lifetimes, as an ID will not panic on use if the underlying object has been destroyed.

func (ID) Instance

func (id ID) Instance() (Instance, bool)

type Instance

type Instance [1]gdclass.Marshalls

Instance of the class with convieniently typed arguments and results.

func (Instance) AsObject

func (self Instance) AsObject() [1]gd.Object

func (Instance) ID

func (self Instance) ID() ID

func (*Instance) SetObject

func (self *Instance) SetObject(obj [1]gd.Object) bool

func (Instance) Virtual

func (self Instance) Virtual(name string) reflect.Value

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL