type typePair … type NameFunc … var DefaultNameFunc … type ConversionFunc … type Converter … // NewConverter creates a new Converter object. // Arg NameFunc is just for backward compatibility. func NewConverter(NameFunc) *Converter { … } // WithConversions returns a Converter that is a copy of c but with the additional // fns merged on top. func (c *Converter) WithConversions(fns ConversionFuncs) *Converter { … } // DefaultMeta returns meta for a given type. func (c *Converter) DefaultMeta(t reflect.Type) *Meta { … } // Convert_Slice_byte_To_Slice_byte prevents recursing into every byte func Convert_Slice_byte_To_Slice_byte(in *[]byte, out *[]byte, s Scope) error { … } type Scope … func NewConversionFuncs() ConversionFuncs { … } type ConversionFuncs … // AddUntyped adds the provided conversion function to the lookup table for the types that are // supplied as a and b. a and b must be pointers or an error is returned. This method overwrites // previously defined functions. func (c ConversionFuncs) AddUntyped(a, b interface{ … } // Merge returns a new ConversionFuncs that contains all conversions from // both other and c, with other conversions taking precedence. func (c ConversionFuncs) Merge(other ConversionFuncs) ConversionFuncs { … } type Meta … type scope … // Convert continues a conversion. func (s *scope) Convert(src, dest interface{ … } // Meta returns the meta object that was originally passed to Convert. func (s *scope) Meta() *Meta { … } // RegisterUntypedConversionFunc registers a function that converts between a and b by passing objects of those // types to the provided function. The function *must* accept objects of a and b - this machinery will not enforce // any other guarantee. func (c *Converter) RegisterUntypedConversionFunc(a, b interface{ … } // RegisterGeneratedUntypedConversionFunc registers a function that converts between a and b by passing objects of those // types to the provided function. The function *must* accept objects of a and b - this machinery will not enforce // any other guarantee. func (c *Converter) RegisterGeneratedUntypedConversionFunc(a, b interface{ … } // RegisterIgnoredConversion registers a "no-op" for conversion, where any requested // conversion between from and to is ignored. func (c *Converter) RegisterIgnoredConversion(from, to interface{ … } // Convert will translate src to dest if it knows how. Both must be pointers. // If no conversion func is registered and the default copying mechanism // doesn't work on this type pair, an error will be returned. // 'meta' is given to allow you to pass information to conversion functions, // it is not used by Convert() other than storing it in the scope. // Not safe for objects with cyclic references! func (c *Converter) Convert(src, dest interface{ … }