coretest

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TestMarshaller

type TestMarshaller struct {
	// contains filtered or unexported fields
}

TestMarshaller returns a Marshaller for testing purposes

JSON encoding is used for the Marshal and Unmarshal methods.

The registered types may be reset using Reset() at any time while testing.

func NewTestMarshaller

func NewTestMarshaller() *TestMarshaller

NewTestMarshaller constructs a new TestMarshaller

func (*TestMarshaller) GetType

func (m *TestMarshaller) GetType(typeName string) reflect.Type

GetType returns the reflect.Type if it has been registered

func (*TestMarshaller) Marshal

func (*TestMarshaller) Marshal(v interface{}) ([]byte, error)

Marshal returns v in byte form

func (*TestMarshaller) RegisterType

func (m *TestMarshaller) RegisterType(typeName string, v reflect.Type)

RegisterType registers a new reflect.Type for the given name key

func (*TestMarshaller) Reset

func (m *TestMarshaller) Reset()

Reset will remove all previously registered types

func (*TestMarshaller) Unmarshal

func (*TestMarshaller) Unmarshal(data []byte, v interface{}) error

Unmarshal returns the bytes marshalled into v

Jump to

Keyboard shortcuts

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