gvariant

package
v0.3.22 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2026 License: MIT Imports: 5 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package gvariant reads GVariant's serialized form (little-endian) for the container and basic types a GTK data blob uses: u, y, b, s, arrays, and tuples. It is a reader over the bytes, not a full implementation: enough to parse GTK's emoji tables and GResource entries without cgo.

Index

Constants

This section is empty.

Variables

View Source
var ErrMalformed = errors.New("gvariant: malformed data")

ErrMalformed is serialized data that does not fit its type.

Functions

This section is empty.

Types

type Value

type Value struct {
	Type string
	Data []byte
}

Value is a serialized value with its type string.

func New

func New(typ string, data []byte) (Value, error)

New wraps bytes of a known type.

func (Value) Elements

func (v Value) Elements() ([]Value, error)

Elements splits an array into its element values.

func (Value) Fields

func (v Value) Fields() ([]Value, error)

Fields splits a tuple into its member values.

func (Value) Str

func (v Value) Str() (string, error)

Str reads an s: the bytes before the terminating nul.

func (Value) Strs

func (v Value) Strs() ([]string, error)

Strs reads an as.

func (Value) Uint32

func (v Value) Uint32() (uint32, error)

Uint32 reads a u.

func (Value) Uint32s

func (v Value) Uint32s() ([]uint32, error)

Uint32s reads an au.

func (Value) Variant

func (v Value) Variant() (Value, error)

Variant unwraps a v: the child value and its type string.

Jump to

Keyboard shortcuts

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