extension

package
v0.8.12 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2022 License: Apache-2.0 Imports: 7 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 IsAuthTypeLengthExceed added in v0.6.0

func IsAuthTypeLengthExceed(err error) bool

IsAuthTypeLengthExceed returns true if input error is for AuthType length exceed.

func IsInvalidAuthenticationBytes added in v0.6.0

func IsInvalidAuthenticationBytes(err error) bool

IsInvalidAuthenticationBytes returns true if input error is for invalid 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 MustNewAuthentication added in v0.6.0

func MustNewAuthentication(authType string, payload []byte) *Authentication

MustNewAuthentication creates a new Authentication

func NewAuthentication added in v0.5.7

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

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 []byte

CompositeMetadata provides multi Metadata payloads with different MIME types.

func NewCompositeMetadataBytes added in v0.5.9

func NewCompositeMetadataBytes(raw []byte) CompositeMetadata

NewCompositeMetadataBytes returns a CompositeMetadata.

func (CompositeMetadata) Scanner added in v0.5.9

Scanner returns a entry scanner.

type CompositeMetadataBuilder added in v0.5.9

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

CompositeMetadataBuilder can be used to build a CompositeMetadata.

func NewCompositeMetadataBuilder added in v0.5.9

func NewCompositeMetadataBuilder() *CompositeMetadataBuilder

NewCompositeMetadataBuilder returns a CompositeMetadata builder.

func (*CompositeMetadataBuilder) Build added in v0.5.9

Build build a new CompositeMetadata.

func (*CompositeMetadataBuilder) Push added in v0.5.9

func (c *CompositeMetadataBuilder) Push(mimeType string, metadata []byte) *CompositeMetadataBuilder

Push push a custom MimeType and metadata bytes.

func (*CompositeMetadataBuilder) PushString added in v0.5.9

func (c *CompositeMetadataBuilder) PushString(mimeType string, metadata string) *CompositeMetadataBuilder

PushString push a custom MimeType and metadata string.

func (*CompositeMetadataBuilder) PushWellKnown added in v0.5.9

func (c *CompositeMetadataBuilder) PushWellKnown(mimeType MIME, metadata []byte) *CompositeMetadataBuilder

PushWellKnown push a WellKnownMimeType and metadata bytes.

func (*CompositeMetadataBuilder) PushWellKnownString added in v0.5.9

func (c *CompositeMetadataBuilder) PushWellKnownString(mimeType MIME, metadata string) *CompositeMetadataBuilder

PushWellKnownString push a WellKnownMimeType and metadata string.

type CompositeMetadataScanner added in v0.5.9

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

CompositeMetadataScanner can be used to scan entry in CompositeMetadata.

func (*CompositeMetadataScanner) Metadata added in v0.5.9

func (c *CompositeMetadataScanner) Metadata() (mimeType string, metadata []byte, err error)

Metadata returns current metadata bytes.

func (*CompositeMetadataScanner) MetadataUTF8 added in v0.5.9

func (c *CompositeMetadataScanner) MetadataUTF8() (mimeType string, metadata string, err error)

MetadataUTF8 returns current metadata in utf8 string.

func (*CompositeMetadataScanner) Scan added in v0.5.9

func (c *CompositeMetadataScanner) Scan() bool

Scan returns true when scanner has more content.

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