go/src/encoding/gob/type.go

type userTypeInfo

const xGob

const xBinary

const xText

var userTypeCache

// validUserType returns, and saves, the information associated with user-provided type rt.
// If the user type is not valid, err will be non-nil. To be used when the error handler
// is not set up.
func validUserType(rt reflect.Type) (*userTypeInfo, error) {}

var gobEncoderInterfaceType

var gobDecoderInterfaceType

var binaryMarshalerInterfaceType

var binaryUnmarshalerInterfaceType

var textMarshalerInterfaceType

var textUnmarshalerInterfaceType

var wireTypeType

// implementsInterface reports whether the type implements the
// gobEncoder/gobDecoder interface.
// It also returns the number of indirections required to get to the
// implementation.
func implementsInterface(typ, gobEncDecType reflect.Type) (success bool, indir int8) {}

// userType returns, and saves, the information associated with user-provided type rt.
// If the user type is not valid, it calls error.
func userType(rt reflect.Type) *userTypeInfo {}

type typeId

var typeLock

const firstUserId

type gobType

var types

var idToTypeSlice

var builtinIdToTypeSlice

func idToType(id typeId) gobType {}

func builtinIdToType(id typeId) gobType {}

func setTypeId(typ gobType) {}

func (t typeId) gobType() gobType {}

// string returns the string representation of the type associated with the typeId.
func (t typeId) string() string {}

// Name returns the name of the type associated with the typeId.
func (t typeId) name() string {}

type CommonType

func (t *CommonType) id() typeId {}

func (t *CommonType) setId(id typeId) {}

func (t *CommonType) string() string {}

func (t *CommonType) safeString(seen map[typeId]bool) string {}

func (t *CommonType) name() string {}

var tBool

var tInt

var tUint

var tFloat

var tBytes

var tString

var tComplex

var tInterface

var tReserved7

var tReserved6

var tReserved5

var tReserved4

var tReserved3

var tReserved2

var tReserved1

var tWireType

var wireTypeUserInfo

func init() {}

type arrayType

func newArrayType(name string) *arrayType {}

func (a *arrayType) init(elem gobType, len int) {}

func (a *arrayType) safeString(seen map[typeId]bool) string {}

func (a *arrayType) string() string {}

type gobEncoderType

func newGobEncoderType(name string) *gobEncoderType {}

func (g *gobEncoderType) safeString(seen map[typeId]bool) string {}

func (g *gobEncoderType) string() string {}

type mapType

func newMapType(name string) *mapType {}

func (m *mapType) init(key, elem gobType) {}

func (m *mapType) safeString(seen map[typeId]bool) string {}

func (m *mapType) string() string {}

type sliceType

func newSliceType(name string) *sliceType {}

func (s *sliceType) init(elem gobType) {}

func (s *sliceType) safeString(seen map[typeId]bool) string {}

func (s *sliceType) string() string {}

type fieldType

type structType

func (s *structType) safeString(seen map[typeId]bool) string {}

func (s *structType) string() string {}

func newStructType(name string) *structType {}

// newTypeObject allocates a gobType for the reflection type rt.
// Unless ut represents a GobEncoder, rt should be the base type
// of ut.
// This is only called from the encoding side. The decoding side
// works through typeIds and userTypeInfos alone.
func newTypeObject(name string, ut *userTypeInfo, rt reflect.Type) (gobType, error) {}

// isExported reports whether this is an exported - upper case - name.
func isExported(name string) bool {}

// isSent reports whether this struct field is to be transmitted.
// It will be transmitted only if it is exported and not a chan or func field
// or pointer to chan or func.
func isSent(field *reflect.StructField) bool {}

// getBaseType returns the Gob type describing the given reflect.Type's base type.
// typeLock must be held.
func getBaseType(name string, rt reflect.Type) (gobType, error) {}

// getType returns the Gob type describing the given reflect.Type.
// Should be called only when handling GobEncoders/Decoders,
// which may be pointers. All other types are handled through the
// base type, never a pointer.
// typeLock must be held.
func getType(name string, ut *userTypeInfo, rt reflect.Type) (gobType, error) {}

func checkId(want, got typeId) {}

// used for building the basic types; called only from init().  the incoming
// interface always refers to a pointer.
func bootstrapType(name string, e any) typeId {}

type wireType

func (w *wireType) string() string {}

type typeInfo

var typeInfoMap

var typeInfoMapInit

func lookupTypeInfo(rt reflect.Type) *typeInfo {}

func getTypeInfo(ut *userTypeInfo) (*typeInfo, error) {}

// buildTypeInfo constructs the type information for the type
// and stores it in the type info map.
func buildTypeInfo(ut *userTypeInfo, rt reflect.Type) (*typeInfo, error) {}

// Called only when a panic is acceptable and unexpected.
func mustGetTypeInfo(rt reflect.Type) *typeInfo {}

type GobEncoder

type GobDecoder

var nameToConcreteType

var concreteTypeToName

// RegisterName is like [Register] but uses the provided name rather than the
// type's default.
func RegisterName(name string, value any) {}

// 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 Register(value any) {}

func registerBasics() {}

func init() {}