common

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const TypeURLField = "pb_type"

Variables

This section is empty.

Functions

func ConvertToBytesReader

func ConvertToBytesReader(reader interface{}) bsonrw.BytesReader

func DecodeStructWithTypeInfo

func DecodeStructWithTypeInfo(
	context bsoncodec.DecodeContext,
	reader bsonrw.ValueReader,
	typeResolver func(string) (reflect.Type, error),
) (reflect.Value, error)

Decode a document with the type information appended as a field. typeResolver must hand back the (non-pointer) message type

func EncodeStructWithTypeInfo

func EncodeStructWithTypeInfo(
	context bsoncodec.EncodeContext,
	writer bsonrw.ValueWriter,
	value proto.Message,
	typeIdentifier string,
) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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