serialize

package
v0.0.0-...-3997da9 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2024 License: GPL-3.0 Imports: 6 Imported by: 2

Documentation

Overview

Package serialize is a simple package to serialize data. It is able to serialize and deserialize interfaces. A custom binary format is generated that is compatible to nothing.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Serializer

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

func New

func New() *Serializer

New creates a new serializer. The serializer is able to serialize and deserialize interfaces. To do that the interface has to be registered with Register.

func (*Serializer) Read

func (s *Serializer) Read(r io.Reader, data any) (err error)

Read reads the data from the reader

func (*Serializer) Register

func (s *Serializer) Register(i any) *Serializer

Register registers a interface for serialization

func (*Serializer) Write

func (s *Serializer) Write(w io.Writer, data any) error

Write writes the data to the writer

Jump to

Keyboard shortcuts

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