ogórek

package module
v0.0.0-...-628eefe Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2017 License: MIT Imports: 10 Imported by: 19 modules, 24 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.

README

ogórek

GoDoc Build Status

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

Fuzz Testing

Fuzz testing has been implemented for the decoder. To run fuzz tests do the following:

go get github.com/dvyukov/go-fuzz/go-fuzz
go get github.com/dvyukov/go-fuzz/go-fuzz-build
go-fuzz-build github.com/kisielk/og-rek
go-fuzz -bin=./ogórek-fuzz.zip -workdir=./fuzz

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     Tuple
}

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 Tuple

type Tuple []interface{}

Tuple is a representation of Python's tuple.

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
⌂ 换网址