meta

package
v0.0.0-...-040724e Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2019 License: BSD-3-Clause, GPL-2.0 Imports: 5 Imported by: 4

Documentation

Overview

Package meta provides functions for manipulating golang objects generically

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FullTypeName

func FullTypeName(obj interface{}) string

FullTypeName returns the full type name of an object

func NameFromType

func NameFromType(t reflect.Type) string

NameFromType returns the full type name from a reflect.Type

func ShallowMerge

func ShallowMerge(value1, value2 interface{}) (interface{}, error)

ShallowMerge merges value2 into value1 and return the result.

Non-zero field values in value2 override the corresponding values in value1.

Types

type MarshalFunc

type MarshalFunc func(obj interface{}) ([]byte, error)

MarshalFunc serializes data into an object

type Marshaler

type Marshaler struct {
	Struct MarshalFunc
}

Marshaler gives on custom on-the-side marshaling functions for specific golang object kinds.

func (*Marshaler) Marshal

func (a *Marshaler) Marshal(obj interface{}) ([]byte, error)

Marshal parses obj and returns its serialization. Custom marshaling functions can be specified on the side.

type UnmarshalFunc

type UnmarshalFunc func(data []byte, obj interface{}) error

UnmarshalFunc deserializes data into an object

type Unmarshaler

type Unmarshaler struct {
	Struct UnmarshalFunc
}

Unmarshaler gives on custom on-the-side unmarshaling functions for specific golang object kinds.

func (*Unmarshaler) Unmarshal

func (a *Unmarshaler) Unmarshal(data []byte, obj interface{}) error

Unmarshal parses the JSON-encoded data and stores the result in the value pointed to by obj. Custom unmarshaling functions can be specified on the side.

Jump to

Keyboard shortcuts

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