message

package
v0.0.0-...-e0c7ee5 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ContentType2EncodingType = map[string]ContentEncodingType{
	"application/json":       EncodingTypeJson,
	"application/x-protobuf": EncodingTypeProtobuf,
}
View Source
var EncodingType2ContentType = map[ContentEncodingType]string{
	EncodingTypeJson:     "application/json",
	EncodingTypeProtobuf: "application/x-protobuf",
}

Functions

func SerializeTo

func SerializeTo(response proto.Message, encodingType ContentEncodingType) (content string, err error)

Types

type ContentEncodingType

type ContentEncodingType int
const (
	EncodingTypeUnknown ContentEncodingType = iota + 1
	EncodingTypeJson
	EncodingTypeProtobuf
)

func DeserializeFrom

func DeserializeFrom(in io.ReadCloser, request proto.Message) (ContentEncodingType, error)

Jump to

Keyboard shortcuts

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