extension

package
v0.5.7 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EncodeRouting added in v0.5.7

func EncodeRouting(tag string, otherTags ...string) (raw []byte, err error)

EncodeRouting encode routing tags to raw bytes.

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 Authentication added in v0.5.7

type Authentication struct {
	// contains filtered or unexported fields
}

Authentication is a necessary component to any real world application. This extension specification provides a standardized mechanism for including both the type of credentials and the credentials in metadata payloads. https://github.com/rsocket/rsocket/blob/master/Extensions/Security/WellKnownAuthTypes.md

func NewAuthentication added in v0.5.7

func NewAuthentication(authType string, payload []byte) Authentication

NewAuthentication creates a new Authentication

func ParseAuthentication added in v0.5.7

func ParseAuthentication(raw []byte) (auth Authentication, err error)

ParseAuthentication parse Authentication from raw bytes.

func (Authentication) Bytes added in v0.5.7

func (a Authentication) Bytes() (raw []byte)

Bytes encodes current Authentication to byte slice.

func (Authentication) IsWellKnown added in v0.5.7

func (a Authentication) IsWellKnown() (ok bool)

IsWellKnown returns true if Authentication Type is Well-Known.

func (Authentication) Payload added in v0.5.7

func (a Authentication) Payload() []byte

Payload returns payload in Authentication.

func (Authentication) Type added in v0.5.7

func (a Authentication) Type() string

Type returns type of Authentication as string.

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
	MessageMimeType          MIME = 0x7A
	MessageAcceptMimeTypes   MIME = 0x7B
	MessageAuthentication    MIME = 0x7C
	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