package gob

Import Path
	encoding/gob (on golang.org and go.dev)

Dependency Relation
	imports 14 packages, and imported by one package

Involved Source Files
	    dec_helpers.go
	    decode.go
	    decoder.go
	d-> doc.go
	    enc_helpers.go
	    encode.go
	    encoder.go
	    error.go
	    type.go

Exported Type Names

type CommonType (struct) CommonType holds elements of all types. It is a historical artifact, kept for binary compatibility and exported only for the benefit of the package's encoding of type descriptors. It is not intended for direct use by clients. Id typeId Name string
type Decoder (struct) A Decoder manages the receipt of type and data information read from the remote side of a connection. It is safe for concurrent use by multiple goroutines. The Decoder does only basic sanity checking on decoded input sizes, and its limits are not configurable. Take caution when decoding gob data from untrusted sources. Decode reads the next value from the input stream and stores it in the data represented by the empty interface value. If e is nil, the value will be discarded. Otherwise, the value underlying e must be a pointer to the correct type for the next data item received. If the input is at EOF, Decode returns io.EOF and does not modify e. DecodeValue reads the next value from the input stream. If v is the zero reflect.Value (v.Kind() == Invalid), DecodeValue discards the value. Otherwise, it stores the value into v. In that case, v must represent a non-nil pointer to data or be an assignable reflect.Value (v.CanSet()) If the input is at EOF, DecodeValue returns io.EOF and does not modify v. func NewDecoder(r io.Reader) *Decoder
type Encoder (struct) An Encoder manages the transmission of type and data information to the other side of a connection. It is safe for concurrent use by multiple goroutines. Encode transmits the data item represented by the empty interface value, guaranteeing that all necessary type information has been transmitted first. Passing a nil pointer to Encoder will panic, as they cannot be transmitted by gob. EncodeValue transmits the data item represented by the reflection value, guaranteeing that all necessary type information has been transmitted first. Passing a nil pointer to EncodeValue will panic, as they cannot be transmitted by gob. func NewEncoder(w io.Writer) *Encoder
type GobDecoder (interface) GobDecoder is the interface describing data that provides its own routine for decoding transmitted values sent by a GobEncoder. GobDecode overwrites the receiver, which must be a pointer, with the value represented by the byte slice, which was written by GobEncode, usually for the same concrete type. math/big.(*Float) math/big.(*Int) math/big.(*Rat) time.(*Time)
type GobEncoder (interface) GobEncoder is the interface describing data that provides its own representation for encoding values for transmission to a GobDecoder. A type that implements GobEncoder and GobDecoder has complete control over the representation of its data and may therefore contain things such as private fields, channels, and functions, which are not usually transmissible in gob streams. Note: Since gobs can be stored permanently, it is good design to guarantee the encoding used by a GobEncoder is stable as the software evolves. For instance, it might make sense for GobEncode to include a version number in the encoding. GobEncode returns a byte slice representing the encoding of the receiver for transmission to a GobDecoder, usually of the same concrete type. math/big.(*Float) math/big.(*Int) math/big.(*Rat) time.Time
Exported Values
func NewDecoder(r io.Reader) *Decoder NewDecoder returns a new decoder that reads from the io.Reader. If r does not also implement io.ByteReader, it will be wrapped in a bufio.Reader.
func NewEncoder(w io.Writer) *Encoder NewEncoder returns a new encoder that will transmit on the io.Writer.
func Register(value interface{}) Register records a type, identified by a value for that type, under its internal type name. That name will identify the concrete type of a value sent or received as an interface variable. Only types that will be transferred as implementations of interface values need to be registered. Expecting to be used only during initialization, it panics if the mapping between types and names is not a bijection.
func RegisterName(name string, value interface{}) RegisterName is like Register but uses the provided name rather than the type's default.