codec

package
v0.0.0-...-de11b45 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2018 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Codec

type Codec interface {
	// Marshal returns the wire format of v.
	Marshal(v interface{}) ([]byte, error)
	// Unmarshal parses the wire format into v.
	Unmarshal(data []byte, v interface{}) error
	// String returns the name of the Codec implementation. The returned
	// string will be used as part of content type in transmission.
	String() string
}

Codec defines the interface gRPC uses to encode and decode messages. Note that implementations of this interface must be thread safe; a Codec's methods can be called from concurrent goroutines.

type ProtoCodec

type ProtoCodec struct {
}

protoCodec is a Codec implementation with protobuf. It is the default codec for gRPC.

func (ProtoCodec) Marshal

func (p ProtoCodec) Marshal(v interface{}) ([]byte, error)

func (ProtoCodec) String

func (ProtoCodec) String() string

func (ProtoCodec) Unmarshal

func (p ProtoCodec) Unmarshal(data []byte, v interface{}) error

Jump to

Keyboard shortcuts

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