ogórek

package
v0.0.0-...-1dcae54 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2017 License: GPL-3.0, MIT Imports: 10 Imported by: 0

README

og-rek

ogórek is a Go library for encoding and decoding pickles.

Documentation

Overview

Package ogórek is a library for decoding Python's pickle format.

ogórek is Polish for "pickle".

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidPickleVersion = errors.New("invalid pickle version")

Functions

This section is empty.

Types

type Call

type Call struct {
	Callable Class
	Args     []interface{}
}

type Class

type Class struct {
	Module, Name string
}

type Decoder

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

Decoder is a decoder for pickle streams.

func NewDecoder

func NewDecoder(r io.Reader) Decoder

NewDecoder constructs a new Decoder which will decode the pickle stream in r.

func (Decoder) Decode

func (d Decoder) Decode() (interface{}, error)

Decode decodes the pickle stream and returns the result or an error.

type Encoder

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

An Encoder encodes Go data structures into pickle byte stream

func NewEncoder

func NewEncoder(w io.Writer) *Encoder

NewEncoder returns a new Encoder struct with default values

func (*Encoder) Encode

func (e *Encoder) Encode(v interface{}) error

Encode writes the pickle encoding of v to w, the encoder's writer

type Marshaler

type Marshaler interface {
	MarshalPickle() (text []byte, err error)
}

Marshaler is the interface implemented by an object that can marshal itself into a binary form.

type None

type None struct{}

None is a representation of Python's None.

type OpcodeError

type OpcodeError struct {
	Key byte
	Pos int
}

func (OpcodeError) Error

func (e OpcodeError) Error() string

type TypeError

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

func (*TypeError) Error

func (te *TypeError) Error() string

Jump to

Keyboard shortcuts

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