framing

package
v0.6.3 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2020 License: Apache-2.0 Imports: 10 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CalcPayloadFrameSize

func CalcPayloadFrameSize(data, metadata []byte) int

CalcPayloadFrameSize returns payload frame size.

func FromBytes

func FromBytes(b []byte) (core.Frame, error)

FromBytes creates frame from a byte slice.

func FromRawFrame

func FromRawFrame(f *RawFrame) (frame core.Frame, err error)

FromRawFrame creates a frame from a RawFrame.

func NewWriteableRequestResponseFrame

func NewWriteableRequestResponseFrame(id uint32, data, metadata []byte, fg core.FrameFlag) core.WriteableFrame

NewWriteableRequestResponseFrame returns a new WriteableRequestResponseFrame.

func NewWriteableRequestStreamFrame

func NewWriteableRequestStreamFrame(id uint32, n uint32, data, metadata []byte, flag core.FrameFlag) core.WriteableFrame

NewWriteableRequestStreamFrame creates a new WriteableRequestStreamFrame.

func PrintFrame

func PrintFrame(f core.WriteableFrame) string

PrintFrame prints frame in bytes dump.

Types

type CancelFrame

type CancelFrame struct {
	*RawFrame
}

CancelFrame is frame of Cancel.

func NewCancelFrame

func NewCancelFrame(sid uint32) *CancelFrame

NewCancelFrame creates cancel frame.

func (CancelFrame) Done

func (t CancelFrame) Done() (closed bool)

Done can be invoked when a frame has been been processed.

func (CancelFrame) DoneNotify

func (t CancelFrame) DoneNotify() <-chan struct{}

DoneNotify notify when frame has been done.

func (CancelFrame) Header

func (t CancelFrame) Header() core.FrameHeader

func (*CancelFrame) Validate

func (f *CancelFrame) Validate() (err error)

Validate returns error if frame is invalid.

type ErrorFrame

type ErrorFrame struct {
	*RawFrame
}

ErrorFrame is error frame.

func NewErrorFrame

func NewErrorFrame(streamID uint32, code core.ErrorCode, data []byte) *ErrorFrame

NewErrorFrame returns a new error frame.

func (ErrorFrame) Done

func (t ErrorFrame) Done() (closed bool)

Done can be invoked when a frame has been been processed.

func (ErrorFrame) DoneNotify

func (t ErrorFrame) DoneNotify() <-chan struct{}

DoneNotify notify when frame has been done.

func (*ErrorFrame) Error

func (p *ErrorFrame) Error() string

Error returns error string.

func (*ErrorFrame) ErrorCode

func (p *ErrorFrame) ErrorCode() core.ErrorCode

ErrorCode returns error code.

func (*ErrorFrame) ErrorData

func (p *ErrorFrame) ErrorData() []byte

ErrorData returns error data bytes.

func (ErrorFrame) Header

func (t ErrorFrame) Header() core.FrameHeader

func (*ErrorFrame) Validate

func (p *ErrorFrame) Validate() (err error)

Validate returns error if frame is invalid.

type FireAndForgetFrame

type FireAndForgetFrame struct {
	*RawFrame
}

FireAndForgetFrame is FireAndForget frame.

func NewFireAndForgetFrame

func NewFireAndForgetFrame(sid uint32, data, metadata []byte, flag core.FrameFlag) *FireAndForgetFrame

NewFireAndForgetFrame returns a new FireAndForgetFrame.

func (*FireAndForgetFrame) Data

func (f *FireAndForgetFrame) Data() []byte

Data returns data bytes.

func (*FireAndForgetFrame) DataUTF8

func (f *FireAndForgetFrame) DataUTF8() string

DataUTF8 returns data as UTF8 string.

func (FireAndForgetFrame) Done

func (t FireAndForgetFrame) Done() (closed bool)

Done can be invoked when a frame has been been processed.

func (FireAndForgetFrame) DoneNotify

func (t FireAndForgetFrame) DoneNotify() <-chan struct{}

DoneNotify notify when frame has been done.

func (FireAndForgetFrame) Header

func (t FireAndForgetFrame) Header() core.FrameHeader

func (*FireAndForgetFrame) Metadata

func (f *FireAndForgetFrame) Metadata() ([]byte, bool)

Metadata returns metadata bytes.

func (*FireAndForgetFrame) MetadataUTF8

func (f *FireAndForgetFrame) MetadataUTF8() (metadata string, ok bool)

MetadataUTF8 returns metadata as UTF8 string.

func (*FireAndForgetFrame) Validate

func (f *FireAndForgetFrame) Validate() (err error)

Validate returns error if frame is invalid.

type KeepaliveFrame

type KeepaliveFrame struct {
	*RawFrame
}

KeepaliveFrame is Keepalive frame.

func NewKeepaliveFrame

func NewKeepaliveFrame(position uint64, data []byte, respond bool) *KeepaliveFrame

NewKeepaliveFrame creates a new KeepaliveFrame.

func (*KeepaliveFrame) Data

func (k *KeepaliveFrame) Data() []byte

Data returns data bytes.

func (KeepaliveFrame) Done

func (t KeepaliveFrame) Done() (closed bool)

Done can be invoked when a frame has been been processed.

func (KeepaliveFrame) DoneNotify

func (t KeepaliveFrame) DoneNotify() <-chan struct{}

DoneNotify notify when frame has been done.

func (KeepaliveFrame) Header

func (t KeepaliveFrame) Header() core.FrameHeader

func (*KeepaliveFrame) LastReceivedPosition

func (k *KeepaliveFrame) LastReceivedPosition() uint64

LastReceivedPosition returns last received position.

func (*KeepaliveFrame) Validate

func (k *KeepaliveFrame) Validate() (err error)

Validate returns error if frame is invalid.

type LeaseFrame

type LeaseFrame struct {
	*RawFrame
}

LeaseFrame is Lease frame.

func NewLeaseFrame

func NewLeaseFrame(ttl time.Duration, n uint32, metadata []byte) *LeaseFrame

NewLeaseFrame creates a new LeaseFrame.

func (LeaseFrame) Done

func (t LeaseFrame) Done() (closed bool)

Done can be invoked when a frame has been been processed.

func (LeaseFrame) DoneNotify

func (t LeaseFrame) DoneNotify() <-chan struct{}

DoneNotify notify when frame has been done.

func (LeaseFrame) Header

func (t LeaseFrame) Header() core.FrameHeader

func (*LeaseFrame) Metadata

func (l *LeaseFrame) Metadata() []byte

Metadata returns metadata bytes.

func (*LeaseFrame) NumberOfRequests

func (l *LeaseFrame) NumberOfRequests() uint32

NumberOfRequests returns number of requests.

func (*LeaseFrame) TimeToLive

func (l *LeaseFrame) TimeToLive() time.Duration

TimeToLive returns time to live duration.

func (*LeaseFrame) Validate

func (l *LeaseFrame) Validate() (err error)

Validate returns error if frame is invalid.

type MetadataPushFrame

type MetadataPushFrame struct {
	*RawFrame
}

MetadataPushFrame is MetadataPush frame.

func NewMetadataPushFrame

func NewMetadataPushFrame(metadata []byte) *MetadataPushFrame

NewMetadataPushFrame returns a new MetadataPushFrame.

func (*MetadataPushFrame) Data

func (m *MetadataPushFrame) Data() []byte

Data returns data bytes.

func (*MetadataPushFrame) DataUTF8

func (m *MetadataPushFrame) DataUTF8() (data string)

DataUTF8 returns data as UTF8 string.

func (MetadataPushFrame) Done

func (t MetadataPushFrame) Done() (closed bool)

Done can be invoked when a frame has been been processed.

func (MetadataPushFrame) DoneNotify

func (t MetadataPushFrame) DoneNotify() <-chan struct{}

DoneNotify notify when frame has been done.

func (MetadataPushFrame) Header

func (t MetadataPushFrame) Header() core.FrameHeader

func (*MetadataPushFrame) Metadata

func (m *MetadataPushFrame) Metadata() ([]byte, bool)

Metadata returns metadata bytes.

func (*MetadataPushFrame) MetadataUTF8

func (m *MetadataPushFrame) MetadataUTF8() (metadata string, ok bool)

MetadataUTF8 returns metadata as UTF8 string.

func (*MetadataPushFrame) Validate

func (m *MetadataPushFrame) Validate() (err error)

Validate returns error if frame is invalid.

type PayloadFrame

type PayloadFrame struct {
	*RawFrame
}

PayloadFrame is payload frame.

func NewPayloadFrame

func NewPayloadFrame(id uint32, data, metadata []byte, flag core.FrameFlag) *PayloadFrame

NewPayloadFrame returns a new PayloadFrame.

func (*PayloadFrame) Data

func (p *PayloadFrame) Data() []byte

Data returns data bytes.

func (*PayloadFrame) DataUTF8

func (p *PayloadFrame) DataUTF8() string

DataUTF8 returns data as UTF8 string.

func (PayloadFrame) Done

func (t PayloadFrame) Done() (closed bool)

Done can be invoked when a frame has been been processed.

func (PayloadFrame) DoneNotify

func (t PayloadFrame) DoneNotify() <-chan struct{}

DoneNotify notify when frame has been done.

func (PayloadFrame) Header

func (t PayloadFrame) Header() core.FrameHeader

func (*PayloadFrame) Metadata

func (p *PayloadFrame) Metadata() ([]byte, bool)

Metadata returns metadata bytes.

func (*PayloadFrame) MetadataUTF8

func (p *PayloadFrame) MetadataUTF8() (metadata string, ok bool)

MetadataUTF8 returns metadata as UTF8 string.

func (*PayloadFrame) Validate

func (p *PayloadFrame) Validate() (err error)

Validate returns error if frame is invalid.

type RawFrame

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

RawFrame is basic frame implementation.

func NewRawFrame

func NewRawFrame(header core.FrameHeader, body *common.ByteBuff) *RawFrame

NewRawFrame returns a new RawFrame.

func (*RawFrame) Body

func (f *RawFrame) Body() *common.ByteBuff

Body returns frame body.

func (RawFrame) Done

func (t RawFrame) Done() (closed bool)

Done can be invoked when a frame has been been processed.

func (RawFrame) DoneNotify

func (t RawFrame) DoneNotify() <-chan struct{}

DoneNotify notify when frame has been done.

func (RawFrame) Header

func (t RawFrame) Header() core.FrameHeader

func (*RawFrame) Len

func (f *RawFrame) Len() int

Len returns length of frame.

func (*RawFrame) WriteTo

func (f *RawFrame) WriteTo(w io.Writer) (n int64, err error)

WriteTo write frame to writer.

type RequestChannelFrame

type RequestChannelFrame struct {
	*RawFrame
}

RequestChannelFrame is RequestChannel frame.

func NewRequestChannelFrame

func NewRequestChannelFrame(sid uint32, n uint32, data, metadata []byte, flag core.FrameFlag) *RequestChannelFrame

NewRequestChannelFrame creates a new RequestChannelFrame.

func (*RequestChannelFrame) Data

func (r *RequestChannelFrame) Data() []byte

Data returns data bytes.

func (*RequestChannelFrame) DataUTF8

func (r *RequestChannelFrame) DataUTF8() string

DataUTF8 returns data as UTF8 string.

func (RequestChannelFrame) Done

func (t RequestChannelFrame) Done() (closed bool)

Done can be invoked when a frame has been been processed.

func (RequestChannelFrame) DoneNotify

func (t RequestChannelFrame) DoneNotify() <-chan struct{}

DoneNotify notify when frame has been done.

func (RequestChannelFrame) Header

func (t RequestChannelFrame) Header() core.FrameHeader

func (*RequestChannelFrame) InitialRequestN

func (r *RequestChannelFrame) InitialRequestN() uint32

InitialRequestN returns initial N.

func (*RequestChannelFrame) Metadata

func (r *RequestChannelFrame) Metadata() ([]byte, bool)

Metadata returns metadata bytes.

func (*RequestChannelFrame) MetadataUTF8

func (r *RequestChannelFrame) MetadataUTF8() (metadata string, ok bool)

MetadataUTF8 returns metadata as UTF8 string.

func (*RequestChannelFrame) Validate

func (r *RequestChannelFrame) Validate() error

Validate returns error if frame is invalid.

type RequestNFrame

type RequestNFrame struct {
	*RawFrame
}

RequestNFrame is RequestN frame.

func NewRequestNFrame

func NewRequestNFrame(sid, n uint32, fg core.FrameFlag) *RequestNFrame

NewRequestNFrame creates a new RequestNFrame.

func (RequestNFrame) Done

func (t RequestNFrame) Done() (closed bool)

Done can be invoked when a frame has been been processed.

func (RequestNFrame) DoneNotify

func (t RequestNFrame) DoneNotify() <-chan struct{}

DoneNotify notify when frame has been done.

func (RequestNFrame) Header

func (t RequestNFrame) Header() core.FrameHeader

func (*RequestNFrame) N

func (r *RequestNFrame) N() uint32

N returns N in RequestN.

func (*RequestNFrame) Validate

func (r *RequestNFrame) Validate() (err error)

Validate returns error if frame is invalid.

type RequestResponseFrame

type RequestResponseFrame struct {
	*RawFrame
}

RequestResponseFrame is RequestResponse frame.

func NewRequestResponseFrame

func NewRequestResponseFrame(id uint32, data, metadata []byte, fg core.FrameFlag) *RequestResponseFrame

NewRequestResponseFrame returns a new RequestResponseFrame.

func (*RequestResponseFrame) Data

func (r *RequestResponseFrame) Data() []byte

Data returns data bytes.

func (*RequestResponseFrame) DataUTF8

func (r *RequestResponseFrame) DataUTF8() string

DataUTF8 returns data as UTF8 string.

func (RequestResponseFrame) Done

func (t RequestResponseFrame) Done() (closed bool)

Done can be invoked when a frame has been been processed.

func (RequestResponseFrame) DoneNotify

func (t RequestResponseFrame) DoneNotify() <-chan struct{}

DoneNotify notify when frame has been done.

func (RequestResponseFrame) Header

func (t RequestResponseFrame) Header() core.FrameHeader

func (*RequestResponseFrame) Metadata

func (r *RequestResponseFrame) Metadata() ([]byte, bool)

Metadata returns metadata bytes.

func (*RequestResponseFrame) MetadataUTF8

func (r *RequestResponseFrame) MetadataUTF8() (metadata string, ok bool)

MetadataUTF8 returns metadata as UTF8 string.

func (*RequestResponseFrame) Validate

func (r *RequestResponseFrame) Validate() (err error)

Validate returns error if frame is invalid.

type RequestStreamFrame

type RequestStreamFrame struct {
	*RawFrame
}

RequestStreamFrame is RequestStream frame.

func NewRequestStreamFrame

func NewRequestStreamFrame(id uint32, n uint32, data, metadata []byte, flag core.FrameFlag) *RequestStreamFrame

NewRequestStreamFrame returns a new RequestStreamFrame.

func (*RequestStreamFrame) Data

func (r *RequestStreamFrame) Data() []byte

Data returns data bytes.

func (*RequestStreamFrame) DataUTF8

func (r *RequestStreamFrame) DataUTF8() string

DataUTF8 returns data as UTF8 string.

func (RequestStreamFrame) Done

func (t RequestStreamFrame) Done() (closed bool)

Done can be invoked when a frame has been been processed.

func (RequestStreamFrame) DoneNotify

func (t RequestStreamFrame) DoneNotify() <-chan struct{}

DoneNotify notify when frame has been done.

func (RequestStreamFrame) Header

func (t RequestStreamFrame) Header() core.FrameHeader

func (*RequestStreamFrame) InitialRequestN

func (r *RequestStreamFrame) InitialRequestN() uint32

InitialRequestN returns initial request N.

func (*RequestStreamFrame) Metadata

func (r *RequestStreamFrame) Metadata() ([]byte, bool)

Metadata returns metadata bytes.

func (*RequestStreamFrame) MetadataUTF8

func (r *RequestStreamFrame) MetadataUTF8() (metadata string, ok bool)

MetadataUTF8 returns metadata as UTF8 string.

func (*RequestStreamFrame) Validate

func (r *RequestStreamFrame) Validate() error

Validate returns error if frame is invalid.

type ResumeFrame

type ResumeFrame struct {
	*RawFrame
}

ResumeFrame is Resume frame.

func NewResumeFrame

func NewResumeFrame(version core.Version, token []byte, firstAvailableClientPosition, lastReceivedServerPosition uint64) *ResumeFrame

NewResumeFrame creates a new ResumeFrame.

func (ResumeFrame) Done

func (t ResumeFrame) Done() (closed bool)

Done can be invoked when a frame has been been processed.

func (ResumeFrame) DoneNotify

func (t ResumeFrame) DoneNotify() <-chan struct{}

DoneNotify notify when frame has been done.

func (*ResumeFrame) FirstAvailableClientPosition

func (r *ResumeFrame) FirstAvailableClientPosition() uint64

FirstAvailableClientPosition returns first available client position.

func (ResumeFrame) Header

func (t ResumeFrame) Header() core.FrameHeader

func (*ResumeFrame) LastReceivedServerPosition

func (r *ResumeFrame) LastReceivedServerPosition() uint64

LastReceivedServerPosition returns last received server position.

func (*ResumeFrame) Token

func (r *ResumeFrame) Token() []byte

Token returns resume token in bytes.

func (*ResumeFrame) Validate

func (r *ResumeFrame) Validate() (err error)

Validate validate current frame.

func (*ResumeFrame) Version

func (r *ResumeFrame) Version() core.Version

Version returns version.

type ResumeOKFrame

type ResumeOKFrame struct {
	*RawFrame
}

ResumeOKFrame is ResumeOK frame.

func NewResumeOKFrame

func NewResumeOKFrame(position uint64) *ResumeOKFrame

NewResumeOKFrame creates a new ResumeOKFrame.

func (ResumeOKFrame) Done

func (t ResumeOKFrame) Done() (closed bool)

Done can be invoked when a frame has been been processed.

func (ResumeOKFrame) DoneNotify

func (t ResumeOKFrame) DoneNotify() <-chan struct{}

DoneNotify notify when frame has been done.

func (ResumeOKFrame) Header

func (t ResumeOKFrame) Header() core.FrameHeader

func (*ResumeOKFrame) LastReceivedClientPosition

func (r *ResumeOKFrame) LastReceivedClientPosition() uint64

LastReceivedClientPosition returns last received client position.

func (*ResumeOKFrame) Validate

func (r *ResumeOKFrame) Validate() (err error)

Validate validate current frame.

type SetupFrame

type SetupFrame struct {
	*RawFrame
}

SetupFrame is Setup frame.

func NewSetupFrame

func NewSetupFrame(
	version core.Version,
	timeBetweenKeepalive,
	maxLifetime time.Duration,
	token []byte,
	mimeMetadata []byte,
	mimeData []byte,
	data []byte,
	metadata []byte,
	lease bool,
) *SetupFrame

NewSetupFrame returns a new SetupFrame.

func (*SetupFrame) Data

func (p *SetupFrame) Data() []byte

Data returns data bytes.

func (*SetupFrame) DataMimeType

func (p *SetupFrame) DataMimeType() (mime string)

DataMimeType returns MIME of data.

func (*SetupFrame) DataUTF8

func (p *SetupFrame) DataUTF8() string

DataUTF8 returns data as UTF8 string.

func (SetupFrame) Done

func (t SetupFrame) Done() (closed bool)

Done can be invoked when a frame has been been processed.

func (SetupFrame) DoneNotify

func (t SetupFrame) DoneNotify() <-chan struct{}

DoneNotify notify when frame has been done.

func (SetupFrame) Header

func (t SetupFrame) Header() core.FrameHeader

func (*SetupFrame) MaxLifetime

func (p *SetupFrame) MaxLifetime() time.Duration

MaxLifetime returns keepalive max lifetime.

func (*SetupFrame) Metadata

func (p *SetupFrame) Metadata() ([]byte, bool)

Metadata returns metadata bytes.

func (*SetupFrame) MetadataMimeType

func (p *SetupFrame) MetadataMimeType() string

MetadataMimeType returns MIME of metadata.

func (*SetupFrame) MetadataUTF8

func (p *SetupFrame) MetadataUTF8() (metadata string, ok bool)

MetadataUTF8 returns metadata as UTF8 string

func (*SetupFrame) TimeBetweenKeepalive

func (p *SetupFrame) TimeBetweenKeepalive() time.Duration

TimeBetweenKeepalive returns keepalive interval duration.

func (*SetupFrame) Token

func (p *SetupFrame) Token() []byte

Token returns token of setup.

func (*SetupFrame) Validate

func (p *SetupFrame) Validate() (err error)

Validate returns error if frame is invalid.

func (*SetupFrame) Version

func (p *SetupFrame) Version() core.Version

Version returns version.

type WriteableCancelFrame

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

WriteableCancelFrame is writeable frame of Cancel.

func NewWriteableCancelFrame

func NewWriteableCancelFrame(id uint32) *WriteableCancelFrame

NewWriteableCancelFrame creates a new WriteableCancelFrame.

func (WriteableCancelFrame) Done

func (t WriteableCancelFrame) Done() (closed bool)

Done can be invoked when a frame has been been processed.

func (WriteableCancelFrame) DoneNotify

func (t WriteableCancelFrame) DoneNotify() <-chan struct{}

DoneNotify notify when frame has been done.

func (WriteableCancelFrame) Header

func (t WriteableCancelFrame) Header() core.FrameHeader

func (WriteableCancelFrame) Len

func (c WriteableCancelFrame) Len() int

Len returns length of frame.

func (WriteableCancelFrame) WriteTo

func (c WriteableCancelFrame) WriteTo(w io.Writer) (n int64, err error)

WriteTo writes current frame to given writer.

type WriteableErrorFrame

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

WriteableErrorFrame is writeable error frame.

func NewWriteableErrorFrame

func NewWriteableErrorFrame(id uint32, code core.ErrorCode, data []byte) *WriteableErrorFrame

NewWriteableErrorFrame creates WriteableErrorFrame.

func (WriteableErrorFrame) Done

func (t WriteableErrorFrame) Done() (closed bool)

Done can be invoked when a frame has been been processed.

func (WriteableErrorFrame) DoneNotify

func (t WriteableErrorFrame) DoneNotify() <-chan struct{}

DoneNotify notify when frame has been done.

func (WriteableErrorFrame) Error

func (e WriteableErrorFrame) Error() string

Error returns error string.

func (WriteableErrorFrame) Header

func (t WriteableErrorFrame) Header() core.FrameHeader

func (WriteableErrorFrame) Len

func (e WriteableErrorFrame) Len() int

Len returns length of frame.

func (WriteableErrorFrame) WriteTo

func (e WriteableErrorFrame) WriteTo(w io.Writer) (n int64, err error)

WriteTo writes frame to writer.

type WriteableFireAndForgetFrame

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

WriteableFireAndForgetFrame is writeable FireAndForget frame.

func NewWriteableFireAndForgetFrame

func NewWriteableFireAndForgetFrame(sid uint32, data, metadata []byte, flag core.FrameFlag) *WriteableFireAndForgetFrame

NewWriteableFireAndForgetFrame creates a new WriteableFireAndForgetFrame.

func (WriteableFireAndForgetFrame) Done

func (t WriteableFireAndForgetFrame) Done() (closed bool)

Done can be invoked when a frame has been been processed.

func (WriteableFireAndForgetFrame) DoneNotify

func (t WriteableFireAndForgetFrame) DoneNotify() <-chan struct{}

DoneNotify notify when frame has been done.

func (WriteableFireAndForgetFrame) Header

func (t WriteableFireAndForgetFrame) Header() core.FrameHeader

func (WriteableFireAndForgetFrame) Len

Len returns length of frame.

func (WriteableFireAndForgetFrame) WriteTo

func (f WriteableFireAndForgetFrame) WriteTo(w io.Writer) (n int64, err error)

WriteTo writes frame to writer.

type WriteableKeepaliveFrame

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

WriteableKeepaliveFrame is writeable Keepalive frame.

func NewWriteableKeepaliveFrame

func NewWriteableKeepaliveFrame(position uint64, data []byte, respond bool) *WriteableKeepaliveFrame

NewWriteableKeepaliveFrame creates a new WriteableKeepaliveFrame.

func (WriteableKeepaliveFrame) Done

func (t WriteableKeepaliveFrame) Done() (closed bool)

Done can be invoked when a frame has been been processed.

func (WriteableKeepaliveFrame) DoneNotify

func (t WriteableKeepaliveFrame) DoneNotify() <-chan struct{}

DoneNotify notify when frame has been done.

func (WriteableKeepaliveFrame) Header

func (t WriteableKeepaliveFrame) Header() core.FrameHeader

func (WriteableKeepaliveFrame) Len

func (k WriteableKeepaliveFrame) Len() int

Len returns length of frame.

func (WriteableKeepaliveFrame) WriteTo

func (k WriteableKeepaliveFrame) WriteTo(w io.Writer) (n int64, err error)

WriteTo writes frame to writer.

type WriteableLeaseFrame

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

WriteableLeaseFrame is writeable Lease frame.

func NewWriteableLeaseFrame

func NewWriteableLeaseFrame(ttl time.Duration, n uint32, metadata []byte) *WriteableLeaseFrame

NewWriteableLeaseFrame creates a new WriteableLeaseFrame.

func (WriteableLeaseFrame) Done

func (t WriteableLeaseFrame) Done() (closed bool)

Done can be invoked when a frame has been been processed.

func (WriteableLeaseFrame) DoneNotify

func (t WriteableLeaseFrame) DoneNotify() <-chan struct{}

DoneNotify notify when frame has been done.

func (WriteableLeaseFrame) Header

func (t WriteableLeaseFrame) Header() core.FrameHeader

func (WriteableLeaseFrame) Len

func (l WriteableLeaseFrame) Len() int

Len returns length of frame.

func (WriteableLeaseFrame) WriteTo

func (l WriteableLeaseFrame) WriteTo(w io.Writer) (n int64, err error)

WriteTo writes frame to writer.

type WriteableMetadataPushFrame

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

WriteableMetadataPushFrame is writeable MetadataPush frame.

func NewWriteableMetadataPushFrame

func NewWriteableMetadataPushFrame(metadata []byte) *WriteableMetadataPushFrame

NewWriteableMetadataPushFrame creates a new WriteableMetadataPushFrame.

func (WriteableMetadataPushFrame) Done

func (t WriteableMetadataPushFrame) Done() (closed bool)

Done can be invoked when a frame has been been processed.

func (WriteableMetadataPushFrame) DoneNotify

func (t WriteableMetadataPushFrame) DoneNotify() <-chan struct{}

DoneNotify notify when frame has been done.

func (WriteableMetadataPushFrame) Header

func (t WriteableMetadataPushFrame) Header() core.FrameHeader

func (WriteableMetadataPushFrame) Len

Len returns length of frame.

func (WriteableMetadataPushFrame) WriteTo

func (m WriteableMetadataPushFrame) WriteTo(w io.Writer) (n int64, err error)

WriteTo writes frame to writer.

type WriteablePayloadFrame

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

WriteablePayloadFrame is writeable Payload frame.

func NewWriteablePayloadFrame

func NewWriteablePayloadFrame(id uint32, data, metadata []byte, flag core.FrameFlag) *WriteablePayloadFrame

NewWriteablePayloadFrame returns a new WriteablePayloadFrame.

func (WriteablePayloadFrame) Data

func (p WriteablePayloadFrame) Data() []byte

Data returns data bytes.

func (WriteablePayloadFrame) DataUTF8

func (p WriteablePayloadFrame) DataUTF8() (data string)

DataUTF8 returns data as UTF8 string.

func (WriteablePayloadFrame) Done

func (t WriteablePayloadFrame) Done() (closed bool)

Done can be invoked when a frame has been been processed.

func (WriteablePayloadFrame) DoneNotify

func (t WriteablePayloadFrame) DoneNotify() <-chan struct{}

DoneNotify notify when frame has been done.

func (WriteablePayloadFrame) Header

func (t WriteablePayloadFrame) Header() core.FrameHeader

func (WriteablePayloadFrame) Len

func (p WriteablePayloadFrame) Len() int

Len returns length of frame.

func (WriteablePayloadFrame) Metadata

func (p WriteablePayloadFrame) Metadata() (metadata []byte, ok bool)

Metadata returns metadata bytes.

func (WriteablePayloadFrame) MetadataUTF8

func (p WriteablePayloadFrame) MetadataUTF8() (metadata string, ok bool)

MetadataUTF8 returns metadata as UTF8 string.

func (WriteablePayloadFrame) WriteTo

func (p WriteablePayloadFrame) WriteTo(w io.Writer) (n int64, err error)

WriteTo writes frame to writer.

type WriteableRequestChannelFrame

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

WriteableRequestChannelFrame is writeable RequestChannel frame.

func NewWriteableRequestChannelFrame

func NewWriteableRequestChannelFrame(sid uint32, n uint32, data, metadata []byte, flag core.FrameFlag) *WriteableRequestChannelFrame

NewWriteableRequestChannelFrame creates a new WriteableRequestChannelFrame.

func (WriteableRequestChannelFrame) Done

func (t WriteableRequestChannelFrame) Done() (closed bool)

Done can be invoked when a frame has been been processed.

func (WriteableRequestChannelFrame) DoneNotify

func (t WriteableRequestChannelFrame) DoneNotify() <-chan struct{}

DoneNotify notify when frame has been done.

func (WriteableRequestChannelFrame) Header

func (t WriteableRequestChannelFrame) Header() core.FrameHeader

func (WriteableRequestChannelFrame) Len

Len returns length of frame.

func (WriteableRequestChannelFrame) WriteTo

func (r WriteableRequestChannelFrame) WriteTo(w io.Writer) (n int64, err error)

WriteTo writes frame to writer.

type WriteableRequestNFrame

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

WriteableRequestNFrame is writeable RequestN frame.

func NewWriteableRequestNFrame

func NewWriteableRequestNFrame(id uint32, n uint32, fg core.FrameFlag) *WriteableRequestNFrame

NewWriteableRequestNFrame creates a new WriteableRequestNFrame.

func (WriteableRequestNFrame) Done

func (t WriteableRequestNFrame) Done() (closed bool)

Done can be invoked when a frame has been been processed.

func (WriteableRequestNFrame) DoneNotify

func (t WriteableRequestNFrame) DoneNotify() <-chan struct{}

DoneNotify notify when frame has been done.

func (WriteableRequestNFrame) Header

func (t WriteableRequestNFrame) Header() core.FrameHeader

func (WriteableRequestNFrame) Len

func (r WriteableRequestNFrame) Len() int

Len returns length of frame.

func (WriteableRequestNFrame) WriteTo

func (r WriteableRequestNFrame) WriteTo(w io.Writer) (n int64, err error)

WriteTo writes frame to writer.

type WriteableRequestResponseFrame

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

WriteableRequestResponseFrame is writeable RequestResponse frame.

func (WriteableRequestResponseFrame) Done

func (t WriteableRequestResponseFrame) Done() (closed bool)

Done can be invoked when a frame has been been processed.

func (WriteableRequestResponseFrame) DoneNotify

func (t WriteableRequestResponseFrame) DoneNotify() <-chan struct{}

DoneNotify notify when frame has been done.

func (WriteableRequestResponseFrame) Header

func (t WriteableRequestResponseFrame) Header() core.FrameHeader

func (WriteableRequestResponseFrame) Len

Len returns length of frame.

func (WriteableRequestResponseFrame) WriteTo

func (r WriteableRequestResponseFrame) WriteTo(w io.Writer) (n int64, err error)

WriteTo writes frame to writer.

type WriteableRequestStreamFrame

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

WriteableRequestStreamFrame is writeable RequestStream frame.

func (WriteableRequestStreamFrame) Done

func (t WriteableRequestStreamFrame) Done() (closed bool)

Done can be invoked when a frame has been been processed.

func (WriteableRequestStreamFrame) DoneNotify

func (t WriteableRequestStreamFrame) DoneNotify() <-chan struct{}

DoneNotify notify when frame has been done.

func (WriteableRequestStreamFrame) Header

func (t WriteableRequestStreamFrame) Header() core.FrameHeader

func (WriteableRequestStreamFrame) Len

Len returns length of frame.

func (WriteableRequestStreamFrame) WriteTo

func (r WriteableRequestStreamFrame) WriteTo(w io.Writer) (n int64, err error)

WriteTo writes frame to writer.

type WriteableResumeFrame

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

WriteableResumeFrame is writeable Resume frame.

func NewWriteableResumeFrame

func NewWriteableResumeFrame(version core.Version, token []byte, firstAvailableClientPosition, lastReceivedServerPosition uint64) *WriteableResumeFrame

NewWriteableResumeFrame creates a new WriteableResumeFrame.

func (WriteableResumeFrame) Done

func (t WriteableResumeFrame) Done() (closed bool)

Done can be invoked when a frame has been been processed.

func (WriteableResumeFrame) DoneNotify

func (t WriteableResumeFrame) DoneNotify() <-chan struct{}

DoneNotify notify when frame has been done.

func (WriteableResumeFrame) Header

func (t WriteableResumeFrame) Header() core.FrameHeader

func (WriteableResumeFrame) Len

func (r WriteableResumeFrame) Len() int

Len returns length of frame.

func (WriteableResumeFrame) WriteTo

func (r WriteableResumeFrame) WriteTo(w io.Writer) (n int64, err error)

WriteTo writes frame to writer.

type WriteableResumeOKFrame

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

WriteableResumeOKFrame is writeable ResumeOK frame.

func NewWriteableResumeOKFrame

func NewWriteableResumeOKFrame(position uint64) *WriteableResumeOKFrame

NewWriteableResumeOKFrame creates a new WriteableResumeOKFrame.

func (WriteableResumeOKFrame) Done

func (t WriteableResumeOKFrame) Done() (closed bool)

Done can be invoked when a frame has been been processed.

func (WriteableResumeOKFrame) DoneNotify

func (t WriteableResumeOKFrame) DoneNotify() <-chan struct{}

DoneNotify notify when frame has been done.

func (WriteableResumeOKFrame) Header

func (t WriteableResumeOKFrame) Header() core.FrameHeader

func (WriteableResumeOKFrame) Len

func (r WriteableResumeOKFrame) Len() int

Len returns length of frame.

func (WriteableResumeOKFrame) WriteTo

func (r WriteableResumeOKFrame) WriteTo(w io.Writer) (n int64, err error)

WriteTo writes frame to writer.

type WriteableSetupFrame

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

WriteableSetupFrame is writeable Setup frame.

func NewWriteableSetupFrame

func NewWriteableSetupFrame(
	version core.Version,
	timeBetweenKeepalive,
	maxLifetime time.Duration,
	token []byte,
	mimeMetadata []byte,
	mimeData []byte,
	data []byte,
	metadata []byte,
	lease bool,
) *WriteableSetupFrame

NewWriteableSetupFrame creates a new WriteableSetupFrame.

func (WriteableSetupFrame) Done

func (t WriteableSetupFrame) Done() (closed bool)

Done can be invoked when a frame has been been processed.

func (WriteableSetupFrame) DoneNotify

func (t WriteableSetupFrame) DoneNotify() <-chan struct{}

DoneNotify notify when frame has been done.

func (WriteableSetupFrame) Header

func (t WriteableSetupFrame) Header() core.FrameHeader

func (WriteableSetupFrame) Len

func (s WriteableSetupFrame) Len() int

Len returns length of frame.

func (WriteableSetupFrame) WriteTo

func (s WriteableSetupFrame) WriteTo(w io.Writer) (n int64, err error)

WriteTo writes frame to writer.

Jump to

Keyboard shortcuts

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