extension

package
v0.5.5 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2020 License: Apache-2.0 Imports: 4 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseRoutingTags

func ParseRoutingTags(bs []byte) (tags []string, err error)

ParseRoutingTags parse routing tags in metadata. See: https://github.com/rsocket/rsocket/blob/master/Extensions/Routing.md

Types

type CompositeMetadata

type CompositeMetadata interface {
	io.WriterTo
	// MIME returns MIME type.
	MIME() string
	// Payload returns bytes of Metadata payload.
	Payload() []byte
	// contains filtered or unexported methods
}

CompositeMetadata provides multi Metadata payloads with different MIME types.

func DecodeCompositeMetadata

func DecodeCompositeMetadata(raw []byte) ([]CompositeMetadata, error)

DecodeCompositeMetadata decode bytes to composite metadata.

func NewCompositeMetadata

func NewCompositeMetadata(mime string, metadataPayload []byte) CompositeMetadata

NewCompositeMetadata returns a new composite metadata.

type MIME

type MIME int8

MIME is MIME types in number. Please see: https://github.com/rsocket/rsocket/blob/master/Extensions/WellKnownMimeTypes.md

const (
	ApplicationAvro MIME = iota
	ApplicationCBOR
	ApplicationGraphql
	ApplicationGzip
	ApplicationJavascript
	ApplicationJSON
	ApplicationOctetStream
	ApplicationPDF
	ApplicationThrift
	ApplicationProtobuf
	ApplicationXML
	ApplicationZip
	AudioAAC
	AudioMP3
	AudioMP4
	AudioMPEG3
	AudioMPEG
	AudioOGG
	AudioOpus
	AudioVorbis
	ImageBMP
	ImageGIF
	ImageHEICSequence
	ImageHEIC
	ImageHEIFSequence
	ImageHEIF
	ImageJPEG
	ImagePNG
	ImageTIFF
	MultipartMixed
	TextCSS
	TextCSV
	TextHTML
	TextPlain
	TextXML
	VideoH264
	VideoH265
	VideoVP8
	Hessian
	JavaObject
	CloudEventsJSON
	MessageZipkin            MIME = 0x7D
	MessageRouting           MIME = 0x7E
	MessageCompositeMetadata MIME = 0x7F
)

All MIMEs

func ParseMIME

func ParseMIME(str string) (mime MIME, ok bool)

ParseMIME parse a string to MIME.

func (MIME) String

func (p MIME) String() string

Jump to

Keyboard shortcuts

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