coder

package
v0.0.0-...-7acfb5e Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterCoder

func RegisterCoder(codec ICoder) error

RegisterCoder registers the provided ICoder for use with all Transport clients and servers.

Types

type ICoder

type ICoder interface {
	Marshal(v interface{}) ([]byte, error)
	Unmarshal(data []byte, v interface{}) error
	Name() string
}

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

func GetCoder

func GetCoder(contentSubtype string) ICoder

GetCoder gets a registered ICoder by content-subtype The content-subtype is expected to be lowercase.

Directories

Path Synopsis
Package proto defines the protobuf Coder.
Package proto defines the protobuf Coder.

Jump to

Keyboard shortcuts

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