phpserialize

package module
v0.0.0-...-23f6b02 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2021 License: Apache-2.0 Imports: 13 Imported by: 0

README

phpserialize

php serialize/unserialize for golang, migrated codes from encoding/json

Documentation

Index

Constants

This section is empty.

Variables

View Source
var SerializePrecision = -1

Functions

func Marshal

func Marshal(v interface{}) ([]byte, error)

func Unmarshal

func Unmarshal(data []byte, v interface{}) error

func Valid

func Valid(data []byte) bool

Types

type Decoder

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

func NewDecoder

func NewDecoder(r io.Reader) *Decoder

func (*Decoder) Buffered

func (dec *Decoder) Buffered() io.Reader

func (*Decoder) Decode

func (dec *Decoder) Decode(v interface{}) error

type Encoder

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

func NewEncoder

func NewEncoder(w io.Writer) *Encoder

func (*Encoder) Encode

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

type InvalidUnmarshalError

type InvalidUnmarshalError struct {
	Type reflect.Type
}

func (*InvalidUnmarshalError) Error

func (e *InvalidUnmarshalError) Error() string

type Marshaler

type Marshaler interface {
	MarshalPHP() ([]byte, error)
}

type MarshalerError

type MarshalerError struct {
	Type reflect.Type
	Err  error
}

func (*MarshalerError) Error

func (e *MarshalerError) Error() string

func (*MarshalerError) Unwrap

func (e *MarshalerError) Unwrap() error

type PHPClass

type PHPClass interface {
	GetPHPClassName() string
}

type RawMessage

type RawMessage []byte

func (RawMessage) MarshalPHP

func (m RawMessage) MarshalPHP() ([]byte, error)

func (*RawMessage) UnmarshalPHP

func (m *RawMessage) UnmarshalPHP(data []byte) error

type Serializer

type Serializer interface {
	SerializePHP() ([]byte, error)
}

type SyntaxError

type SyntaxError struct {
	Offset int64
	// contains filtered or unexported fields
}

func (*SyntaxError) Error

func (e *SyntaxError) Error() string

type UnSerializer

type UnSerializer interface {
	UnSerializePHP([]byte) error
}

type UnmarshalTypeError

type UnmarshalTypeError struct {
	Value  string
	Type   reflect.Type
	Offset int64
	Struct string
	Field  string
}

func (*UnmarshalTypeError) Error

func (e *UnmarshalTypeError) Error() string

type Unmarshaler

type Unmarshaler interface {
	UnmarshalPHP([]byte) error
}

type UnsupportedTypeError

type UnsupportedTypeError struct {
	Type reflect.Type
}

func (*UnsupportedTypeError) Error

func (e *UnsupportedTypeError) Error() string

type UnsupportedValueError

type UnsupportedValueError struct {
	Value reflect.Value
	Str   string
}

func (*UnsupportedValueError) Error

func (e *UnsupportedValueError) Error() string

Jump to

Keyboard shortcuts

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