gob

package
v2.4.1 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Overview

Package gob encodes/decodes Agent messages

Index

Constants

View Source
const (
	STRING   = 0
	BASE     = 1
	DELEGATE = 2
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Coder

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

func NewEncoder

func NewEncoder(concrete int) *Coder

NewEncoder is a factory that returns a structure that implements the Transformer interface

func (*Coder) Construct

func (c *Coder) Construct(data any, key []byte) ([]byte, error)

Construct takes in data, Gob encodes it, and returns the encoded data as bytes

func (*Coder) Decode

func (c *Coder) Decode(data []byte) (any, error)

Decode takes in bytes and Gob decodes it to its original type This function is exported so that it can be called directly outside the Transformer interface

func (*Coder) Deconstruct

func (c *Coder) Deconstruct(data, key []byte) (any, error)

Deconstruct takes in bytes and Gob decodes it to its original type

func (*Coder) Encode

func (c *Coder) Encode(e any) ([]byte, error)

Encode takes in data, Gob encodes it, and returns the encoded data as bytes This function is exported so that it can be called directly outside the Transformer interface

func (*Coder) String

func (c *Coder) String() string

String converts the Gob encode/decode constant to a string

Jump to

Keyboard shortcuts

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