etf

package module
v0.0.0-...-023937b Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2025 License: MIT Imports: 9 Imported by: 0

README

etf

Erlang external term format encoding/decoding for Go. Forked from github.com/goerlang/etf. This project is not intended for any kind of serious use. Maybe it will be one day, but I only forked it because I was experimenting and the original wasn't quite working.

Documentation

Index

Constants

View Source
const (
	// Erlang external term format version
	EtVersion = byte(131)
)

Variables

View Source
var (
	ErrFloatScan = fmt.Errorf("read: failed to sscanf float")
)

Functions

This section is empty.

Types

type Atom

type Atom string

type Context

type Context struct {
	// contains filtered or unexported fields
}

Context stores globally useful information that can carry between reads and writes, such as caching of atoms.

func (*Context) Decoder

func (c *Context) Decoder(r io.Reader) *Decoder

func (*Context) Encoder

func (c *Context) Encoder(w io.Writer) *Encoder

type Decoder

type Decoder struct {
	// contains filtered or unexported fields
}

func (*Decoder) Decode

func (d *Decoder) Decode() (term Term, err error)

Decode reads the next term from the underlying reader.

type Encoder

type Encoder struct {
	// contains filtered or unexported fields
}

func (*Encoder) Encode

func (e *Encoder) Encode(term any) (err error)

func (*Encoder) EncodeTerm

func (e *Encoder) EncodeTerm(term any) (err error)

type ErrUnknownTerm

type ErrUnknownTerm struct {
	// contains filtered or unexported fields
}

func (*ErrUnknownTerm) Error

func (e *ErrUnknownTerm) Error() string

type ErrUnknownType

type ErrUnknownType struct {
	// contains filtered or unexported fields
}

ErrUnknownType is returned by an attempt to write a type that isn't supported.

func (*ErrUnknownType) Error

func (e *ErrUnknownType) Error() string

type Export

type Export struct {
	Module   Atom
	Function Atom
	Arity    byte
}

type Function

type Function struct {
	Arity     byte
	Unique    [16]byte
	Index     uint32
	Free      uint32
	Module    Atom
	OldIndex  uint32
	OldUnique uint32
	Pid       Pid
	FreeVars  []Term
}

type List

type List []Term

type Pid

type Pid struct {
	Node     Atom
	Id       uint32
	Serial   uint32
	Creation byte
}

type Port

type Port struct {
	Node     Atom
	Id       uint32
	Creation byte
}

type Ref

type Ref struct {
	Node     Atom
	Creation byte
	Id       []uint32
}

type Term

type Term any

type Tuple

type Tuple []Term

func (Tuple) Element

func (t Tuple) Element(i int) Term

Jump to

Keyboard shortcuts

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