gob

package
v0.0.0-...-16c191e Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2022 License: BSD-3-Clause Imports: 3 Imported by: 0

README

gob 编码

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultCoder = NewGobCoder()
)

Functions

func Marshal

func Marshal(v any) ([]byte, error)

func MarshalTo

func MarshalTo(v any, w io.Writer) error

func Unmarshal

func Unmarshal(data []byte, v any) error

func UnmarshalFrom

func UnmarshalFrom(r io.Reader, v any) error

Types

type GobCoder

type GobCoder struct {
}

gob 协议

func NewGobCoder

func NewGobCoder() *GobCoder

func (*GobCoder) Marshal

func (g *GobCoder) Marshal(v any) ([]byte, error)

func (*GobCoder) MarshalTo

func (g *GobCoder) MarshalTo(v any, w io.Writer) error

func (*GobCoder) String

func (g *GobCoder) String() string

func (*GobCoder) Unmarshal

func (g *GobCoder) Unmarshal(data []byte, v any) error

func (*GobCoder) UnmarshalFrom

func (g *GobCoder) UnmarshalFrom(r io.Reader, v any) error

Jump to

Keyboard shortcuts

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