serializer

package
v0.0.0-...-83f64a2 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// json raccoon message serializer
	JSON = json.Marshal

	// proto raccoon message serializer
	PROTO = func(m interface{}) ([]byte, error) {
		msg, ok := m.(proto.Message)
		if !ok {
			return nil, errors.New("unable to marshal non proto")
		}
		return proto.Marshal(msg)
	}
)

Functions

This section is empty.

Types

type SerializerFunc

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

SerializerFunc defines a conversion for raccoon message to byte sequence.

Jump to

Keyboard shortcuts

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