Documentation
¶
Index ¶
- func DiscoverInterfaces(structType reflect.Type, interfaces KnownInterface) []reflect.Type
- func GetImplementedInterfacesDescriptor(val reflect.Value, mr Marshalizer) map[string][]string
- func GetInterfaceDescriptor(typ reflect.Type, mr Marshalizer) []string
- func IsReadable(object any) any
- func IsRecurcive(object any) any
- func PFormat(object any, stream io.Writer, indent, width, depth int, ...) string
- func PP(object any, stream io.Writer, indent, width, depth int, ...)
- func PPrint(object any, stream io.Writer, indent, width, depth int, ...)
- func SafeRepr(object any) any
- func SerializeFuncSignature(val reflect.Value, mr Marshalizer) any
- func SerializeMap(val reflect.Value, mr Marshalizer) any
- func SerializeMethodSignature(method reflect.Method, mr Marshalizer) string
- func SerializePointer(val reflect.Value, mr Marshalizer) any
- func SerializeSlice(val reflect.Value, mr Marshalizer) any
- func SerializeStruct(val reflect.Value, mr Marshalizer) any
- type Context
- type DispatchMap
- type InaccessibleField
- type KindSerializerMap
- type KnownInterface
- type MappingItem
- type Marshalizer
- func (mr Marshalizer) AddKind(kind reflect.Kind, serializer Serializer)
- func (mr Marshalizer) AddKnownInterface(typ reflect.Type)
- func (mr Marshalizer) AddType(typ reflect.Type, serializer Serializer)
- func (mr Marshalizer) RemoveKind(kind reflect.Kind)
- func (mr Marshalizer) RemoveKnownInterface(typ reflect.Type)
- func (mr Marshalizer) RemoveType(typ reflect.Type)
- func (mr Marshalizer) Serialize(object any) ([]byte, error)
- func (mr Marshalizer) String() string
- type MarshalizerContext
- type MarshalizerInterface
- type PrettyPrinter
- func (pp PrettyPrinter) Format(object any, context Context, maxLevels, level int) (string, bool, bool)
- func (pp PrettyPrinter) IsReadable(object any) bool
- func (pp PrettyPrinter) IsRecursive(object any) bool
- func (pp PrettyPrinter) PFormat(object any) string
- func (pp PrettyPrinter) PPrint(object any)
- type PrettyPrinterInterface
- type Serializer
- type SerializerRegistryInterface
- type SerializersRegistry
- func (sr SerializersRegistry) AddKind(kind reflect.Kind, serializer Serializer)
- func (sr SerializersRegistry) AddKnownInterface(typ reflect.Type)
- func (sr SerializersRegistry) AddType(typ reflect.Type, serializer Serializer)
- func (sr SerializersRegistry) RemoveKind(kind reflect.Kind)
- func (sr SerializersRegistry) RemoveKnownInterface(typ reflect.Type)
- func (sr SerializersRegistry) RemoveType(typ reflect.Type)
- type StructField
- type TypeSerializerMap
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DiscoverInterfaces ¶
func DiscoverInterfaces(structType reflect.Type, interfaces KnownInterface) []reflect.Type
DiscoverInterfaces dynamically finds all interfaces implemented by a given struct.
func GetImplementedInterfacesDescriptor ¶
func GetImplementedInterfacesDescriptor(val reflect.Value, mr Marshalizer) map[string][]string
func GetInterfaceDescriptor ¶
func GetInterfaceDescriptor(typ reflect.Type, mr Marshalizer) []string
func IsReadable ¶
func IsRecurcive ¶
func SerializeFuncSignature ¶
func SerializeFuncSignature(val reflect.Value, mr Marshalizer) any
func SerializeMap ¶
func SerializeMap(val reflect.Value, mr Marshalizer) any
func SerializeMethodSignature ¶
func SerializeMethodSignature(method reflect.Method, mr Marshalizer) string
func SerializePointer ¶
func SerializePointer(val reflect.Value, mr Marshalizer) any
func SerializeSlice ¶
func SerializeSlice(val reflect.Value, mr Marshalizer) any
func SerializeStruct ¶
func SerializeStruct(val reflect.Value, mr Marshalizer) any
Types ¶
type DispatchMap ¶
type InaccessibleField ¶
func (InaccessibleField) String ¶
func (i InaccessibleField) String() string
type KindSerializerMap ¶
type KindSerializerMap map[reflect.Kind]Serializer
type KnownInterface ¶
type MappingItem ¶
type Marshalizer ¶
type Marshalizer struct {
// contains filtered or unexported fields
}
func (Marshalizer) AddKind ¶
func (mr Marshalizer) AddKind(kind reflect.Kind, serializer Serializer)
func (Marshalizer) AddKnownInterface ¶
func (mr Marshalizer) AddKnownInterface(typ reflect.Type)
func (Marshalizer) AddType ¶
func (mr Marshalizer) AddType(typ reflect.Type, serializer Serializer)
func (Marshalizer) RemoveKind ¶
func (mr Marshalizer) RemoveKind(kind reflect.Kind)
func (Marshalizer) RemoveKnownInterface ¶
func (mr Marshalizer) RemoveKnownInterface(typ reflect.Type)
func (Marshalizer) RemoveType ¶
func (mr Marshalizer) RemoveType(typ reflect.Type)
func (Marshalizer) String ¶
func (mr Marshalizer) String() string
type MarshalizerContext ¶
type MarshalizerInterface ¶
func NewMarshalizer ¶
func NewMarshalizer(includePrivateFields bool, escapeHTML bool, emptyRegistry bool, includeImplements bool) MarshalizerInterface
type PrettyPrinter ¶
type PrettyPrinter struct {
// contains filtered or unexported fields
}
func (PrettyPrinter) IsReadable ¶
func (pp PrettyPrinter) IsReadable(object any) bool
func (PrettyPrinter) IsRecursive ¶
func (pp PrettyPrinter) IsRecursive(object any) bool
func (PrettyPrinter) PFormat ¶
func (pp PrettyPrinter) PFormat(object any) string
func (PrettyPrinter) PPrint ¶
func (pp PrettyPrinter) PPrint(object any)
type PrettyPrinterInterface ¶
type PrettyPrinterInterface interface {
PPrint(object any) // +
PFormat(object any) string // +
IsRecursive(object any) bool // +
IsReadable(object any) bool // +
Format(object any, context Context, maxLevels, level int) (string, bool, bool) // +
// contains filtered or unexported methods
}
func NewPrettyPrinter ¶
type Serializer ¶
type Serializer func(val reflect.Value, mr Marshalizer) any
type SerializersRegistry ¶
type SerializersRegistry struct {
// contains filtered or unexported fields
}
func (SerializersRegistry) AddKind ¶
func (sr SerializersRegistry) AddKind(kind reflect.Kind, serializer Serializer)
func (SerializersRegistry) AddKnownInterface ¶
func (sr SerializersRegistry) AddKnownInterface(typ reflect.Type)
func (SerializersRegistry) AddType ¶
func (sr SerializersRegistry) AddType(typ reflect.Type, serializer Serializer)
func (SerializersRegistry) RemoveKind ¶
func (sr SerializersRegistry) RemoveKind(kind reflect.Kind)
func (SerializersRegistry) RemoveKnownInterface ¶
func (sr SerializersRegistry) RemoveKnownInterface(typ reflect.Type)
func (SerializersRegistry) RemoveType ¶
func (sr SerializersRegistry) RemoveType(typ reflect.Type)
type StructField ¶
type TypeSerializerMap ¶
type TypeSerializerMap map[reflect.Type]Serializer
Click to show internal directories.
Click to hide internal directories.