framing

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: 14 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) (f core.BufferedFrame, err error)

FromBytes creates frame from a byte slice.

func PrintFrame

func PrintFrame(f core.Frame) string

PrintFrame prints frame in bytes dump.

Types

type CancelFrame

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

CancelFrame is frame of Cancel.

func NewCancelFrame

func NewCancelFrame(sid uint32) *CancelFrame

NewCancelFrame creates cancel frame.

func (CancelFrame) Body added in v0.7.0

func (f CancelFrame) Body() []byte

Body returns frame body.

func (CancelFrame) HasFlag added in v0.7.0

func (f CancelFrame) HasFlag(flag core.FrameFlag) bool

func (CancelFrame) Header

func (f CancelFrame) Header() core.FrameHeader

func (CancelFrame) IncRef added in v0.7.0

func (f CancelFrame) IncRef() int32

func (CancelFrame) Len added in v0.7.0

func (f CancelFrame) Len() int

Len returns length of frame.

func (CancelFrame) RefCnt added in v0.7.0

func (f CancelFrame) RefCnt() int32

func (CancelFrame) Release added in v0.7.0

func (f CancelFrame) Release()

Release releases resource.

func (CancelFrame) StreamID added in v0.7.5

func (f CancelFrame) StreamID() uint32

func (*CancelFrame) Validate

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

Validate returns error if frame is invalid.

func (CancelFrame) WriteTo added in v0.7.0

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

WriteTo write frame to writer.

type ErrorFrame

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

ErrorFrame is error frame.

func NewErrorFrame

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

NewErrorFrame returns a new error frame.

func (ErrorFrame) Body added in v0.7.0

func (f ErrorFrame) Body() []byte

Body returns frame body.

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) HasFlag added in v0.7.0

func (f ErrorFrame) HasFlag(flag core.FrameFlag) bool

func (ErrorFrame) Header

func (f ErrorFrame) Header() core.FrameHeader

func (ErrorFrame) IncRef added in v0.7.0

func (f ErrorFrame) IncRef() int32

func (ErrorFrame) Len added in v0.7.0

func (f ErrorFrame) Len() int

Len returns length of frame.

func (ErrorFrame) RefCnt added in v0.7.0

func (f ErrorFrame) RefCnt() int32

func (ErrorFrame) Release added in v0.7.0

func (f ErrorFrame) Release()

Release releases resource.

func (ErrorFrame) StreamID added in v0.7.5

func (f ErrorFrame) StreamID() uint32

func (*ErrorFrame) ToError added in v0.7.0

func (p *ErrorFrame) ToError() error

func (*ErrorFrame) Validate

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

Validate returns error if frame is invalid.

func (ErrorFrame) WriteTo added in v0.7.0

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

WriteTo write frame to writer.

type FireAndForgetFrame

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

FireAndForgetFrame is FireAndForget frame.

func NewFireAndForgetFrame

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

NewFireAndForgetFrame returns a new FireAndForgetFrame.

func (FireAndForgetFrame) Body added in v0.7.0

func (f FireAndForgetFrame) Body() []byte

Body returns frame body.

func (*FireAndForgetFrame) Data

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

Data returns data bytes.

func (*FireAndForgetFrame) DataUTF8

func (f *FireAndForgetFrame) DataUTF8() (data string)

DataUTF8 returns data as UTF8 string.

func (FireAndForgetFrame) HasFlag added in v0.7.0

func (f FireAndForgetFrame) HasFlag(flag core.FrameFlag) bool

func (FireAndForgetFrame) Header

func (f FireAndForgetFrame) Header() core.FrameHeader

func (FireAndForgetFrame) IncRef added in v0.7.0

func (f FireAndForgetFrame) IncRef() int32

func (FireAndForgetFrame) Len added in v0.7.0

func (f FireAndForgetFrame) Len() int

Len returns length of frame.

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) RefCnt added in v0.7.0

func (f FireAndForgetFrame) RefCnt() int32

func (FireAndForgetFrame) Release added in v0.7.0

func (f FireAndForgetFrame) Release()

Release releases resource.

func (FireAndForgetFrame) StreamID added in v0.7.5

func (f FireAndForgetFrame) StreamID() uint32

func (*FireAndForgetFrame) Validate

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

Validate returns error if frame is invalid.

func (FireAndForgetFrame) WriteTo added in v0.7.0

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

WriteTo write frame to writer.

type KeepaliveFrame

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

KeepaliveFrame is Keepalive frame.

func NewKeepaliveFrame

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

NewKeepaliveFrame creates a new KeepaliveFrame.

func (KeepaliveFrame) Body added in v0.7.0

func (f KeepaliveFrame) Body() []byte

Body returns frame body.

func (*KeepaliveFrame) Data

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

Data returns data bytes.

func (KeepaliveFrame) HasFlag added in v0.7.0

func (f KeepaliveFrame) HasFlag(flag core.FrameFlag) bool

func (KeepaliveFrame) Header

func (f KeepaliveFrame) Header() core.FrameHeader

func (KeepaliveFrame) IncRef added in v0.7.0

func (f KeepaliveFrame) IncRef() int32

func (*KeepaliveFrame) LastReceivedPosition

func (k *KeepaliveFrame) LastReceivedPosition() uint64

LastReceivedPosition returns last received position.

func (KeepaliveFrame) Len added in v0.7.0

func (f KeepaliveFrame) Len() int

Len returns length of frame.

func (KeepaliveFrame) RefCnt added in v0.7.0

func (f KeepaliveFrame) RefCnt() int32

func (KeepaliveFrame) Release added in v0.7.0

func (f KeepaliveFrame) Release()

Release releases resource.

func (KeepaliveFrame) StreamID added in v0.7.5

func (f KeepaliveFrame) StreamID() uint32

func (*KeepaliveFrame) Validate

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

Validate returns error if frame is invalid.

func (KeepaliveFrame) WriteTo added in v0.7.0

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

WriteTo write frame to writer.

type LeaseFrame

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

LeaseFrame is Lease frame.

func NewLeaseFrame

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

NewLeaseFrame creates a new LeaseFrame.

func (LeaseFrame) Body added in v0.7.0

func (f LeaseFrame) Body() []byte

Body returns frame body.

func (LeaseFrame) HasFlag added in v0.7.0

func (f LeaseFrame) HasFlag(flag core.FrameFlag) bool

func (LeaseFrame) Header

func (f LeaseFrame) Header() core.FrameHeader

func (LeaseFrame) IncRef added in v0.7.0

func (f LeaseFrame) IncRef() int32

func (LeaseFrame) Len added in v0.7.0

func (f LeaseFrame) Len() int

Len returns length of frame.

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) RefCnt added in v0.7.0

func (f LeaseFrame) RefCnt() int32

func (LeaseFrame) Release added in v0.7.0

func (f LeaseFrame) Release()

Release releases resource.

func (LeaseFrame) StreamID added in v0.7.5

func (f LeaseFrame) StreamID() uint32

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.

func (LeaseFrame) WriteTo added in v0.7.0

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

WriteTo write frame to writer.

type MetadataPushFrame

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

MetadataPushFrame is MetadataPush frame.

func NewMetadataPushFrame

func NewMetadataPushFrame(metadata []byte) *MetadataPushFrame

NewMetadataPushFrame returns a new MetadataPushFrame.

func (MetadataPushFrame) Body added in v0.7.0

func (f MetadataPushFrame) Body() []byte

Body returns frame body.

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) HasFlag added in v0.7.0

func (f MetadataPushFrame) HasFlag(flag core.FrameFlag) bool

func (MetadataPushFrame) Header

func (f MetadataPushFrame) Header() core.FrameHeader

func (MetadataPushFrame) IncRef added in v0.7.0

func (f MetadataPushFrame) IncRef() int32

func (MetadataPushFrame) Len added in v0.7.0

func (f MetadataPushFrame) Len() int

Len returns length of frame.

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) RefCnt added in v0.7.0

func (f MetadataPushFrame) RefCnt() int32

func (MetadataPushFrame) Release added in v0.7.0

func (f MetadataPushFrame) Release()

Release releases resource.

func (MetadataPushFrame) StreamID added in v0.7.5

func (f MetadataPushFrame) StreamID() uint32

func (*MetadataPushFrame) Validate

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

Validate returns error if frame is invalid.

func (MetadataPushFrame) WriteTo added in v0.7.0

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

WriteTo write frame to writer.

type PayloadFrame

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

PayloadFrame is payload frame.

func NewPayloadFrame

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

NewPayloadFrame returns a new PayloadFrame.

func (PayloadFrame) Body added in v0.7.0

func (f PayloadFrame) Body() []byte

Body returns frame body.

func (*PayloadFrame) Data

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

Data returns data bytes.

func (*PayloadFrame) DataUTF8

func (p *PayloadFrame) DataUTF8() (data string)

DataUTF8 returns data as UTF8 string.

func (PayloadFrame) HasFlag added in v0.7.0

func (f PayloadFrame) HasFlag(flag core.FrameFlag) bool

func (PayloadFrame) Header

func (f PayloadFrame) Header() core.FrameHeader

func (PayloadFrame) IncRef added in v0.7.0

func (f PayloadFrame) IncRef() int32

func (PayloadFrame) Len added in v0.7.0

func (f PayloadFrame) Len() int

Len returns length of frame.

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) RefCnt added in v0.7.0

func (f PayloadFrame) RefCnt() int32

func (PayloadFrame) Release added in v0.7.0

func (f PayloadFrame) Release()

Release releases resource.

func (PayloadFrame) StreamID added in v0.7.5

func (f PayloadFrame) StreamID() uint32

func (*PayloadFrame) Validate

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

Validate returns error if frame is invalid.

func (PayloadFrame) WriteTo added in v0.7.0

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

WriteTo write frame to writer.

type RequestChannelFrame

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

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) Body added in v0.7.0

func (f RequestChannelFrame) Body() []byte

Body returns frame body.

func (*RequestChannelFrame) Data

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

Data returns data bytes.

func (*RequestChannelFrame) DataUTF8

func (r *RequestChannelFrame) DataUTF8() (data string)

DataUTF8 returns data as UTF8 string.

func (RequestChannelFrame) HasFlag added in v0.7.0

func (f RequestChannelFrame) HasFlag(flag core.FrameFlag) bool

func (RequestChannelFrame) Header

func (f RequestChannelFrame) Header() core.FrameHeader

func (RequestChannelFrame) IncRef added in v0.7.0

func (f RequestChannelFrame) IncRef() int32

func (*RequestChannelFrame) InitialRequestN

func (r *RequestChannelFrame) InitialRequestN() uint32

InitialRequestN returns initial N.

func (RequestChannelFrame) Len added in v0.7.0

func (f RequestChannelFrame) Len() int

Len returns length of frame.

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) RefCnt added in v0.7.0

func (f RequestChannelFrame) RefCnt() int32

func (RequestChannelFrame) Release added in v0.7.0

func (f RequestChannelFrame) Release()

Release releases resource.

func (RequestChannelFrame) StreamID added in v0.7.5

func (f RequestChannelFrame) StreamID() uint32

func (*RequestChannelFrame) Validate

func (r *RequestChannelFrame) Validate() error

Validate returns error if frame is invalid.

func (RequestChannelFrame) WriteTo added in v0.7.0

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

WriteTo write frame to writer.

type RequestNFrame

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

RequestNFrame is RequestN frame.

func NewRequestNFrame

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

NewRequestNFrame creates a new RequestNFrame.

func (RequestNFrame) Body added in v0.7.0

func (f RequestNFrame) Body() []byte

Body returns frame body.

func (RequestNFrame) HasFlag added in v0.7.0

func (f RequestNFrame) HasFlag(flag core.FrameFlag) bool

func (RequestNFrame) Header

func (f RequestNFrame) Header() core.FrameHeader

func (RequestNFrame) IncRef added in v0.7.0

func (f RequestNFrame) IncRef() int32

func (RequestNFrame) Len added in v0.7.0

func (f RequestNFrame) Len() int

Len returns length of frame.

func (*RequestNFrame) N

func (r *RequestNFrame) N() uint32

N returns N in RequestN.

func (RequestNFrame) RefCnt added in v0.7.0

func (f RequestNFrame) RefCnt() int32

func (RequestNFrame) Release added in v0.7.0

func (f RequestNFrame) Release()

Release releases resource.

func (RequestNFrame) StreamID added in v0.7.5

func (f RequestNFrame) StreamID() uint32

func (*RequestNFrame) Validate

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

Validate returns error if frame is invalid.

func (RequestNFrame) WriteTo added in v0.7.0

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

WriteTo write frame to writer.

type RequestResponseFrame

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

RequestResponseFrame is RequestResponse frame.

func NewRequestResponseFrame

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

NewRequestResponseFrame returns a new RequestResponseFrame.

func (RequestResponseFrame) Body added in v0.7.0

func (f RequestResponseFrame) Body() []byte

Body returns frame body.

func (*RequestResponseFrame) Data

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

Data returns data bytes.

func (*RequestResponseFrame) DataUTF8

func (r *RequestResponseFrame) DataUTF8() (data string)

DataUTF8 returns data as UTF8 string.

func (RequestResponseFrame) HasFlag added in v0.7.0

func (f RequestResponseFrame) HasFlag(flag core.FrameFlag) bool

func (RequestResponseFrame) Header

func (f RequestResponseFrame) Header() core.FrameHeader

func (RequestResponseFrame) IncRef added in v0.7.0

func (f RequestResponseFrame) IncRef() int32

func (RequestResponseFrame) Len added in v0.7.0

func (f RequestResponseFrame) Len() int

Len returns length of frame.

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) RefCnt added in v0.7.0

func (f RequestResponseFrame) RefCnt() int32

func (RequestResponseFrame) Release added in v0.7.0

func (f RequestResponseFrame) Release()

Release releases resource.

func (RequestResponseFrame) StreamID added in v0.7.5

func (f RequestResponseFrame) StreamID() uint32

func (*RequestResponseFrame) Validate

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

Validate returns error if frame is invalid.

func (RequestResponseFrame) WriteTo added in v0.7.0

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

WriteTo write frame to writer.

type RequestStreamFrame

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

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) Body added in v0.7.0

func (f RequestStreamFrame) Body() []byte

Body returns frame body.

func (*RequestStreamFrame) Data

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

Data returns data bytes.

func (*RequestStreamFrame) DataUTF8

func (r *RequestStreamFrame) DataUTF8() (data string)

DataUTF8 returns data as UTF8 string.

func (RequestStreamFrame) HasFlag added in v0.7.0

func (f RequestStreamFrame) HasFlag(flag core.FrameFlag) bool

func (RequestStreamFrame) Header

func (f RequestStreamFrame) Header() core.FrameHeader

func (RequestStreamFrame) IncRef added in v0.7.0

func (f RequestStreamFrame) IncRef() int32

func (*RequestStreamFrame) InitialRequestN

func (r *RequestStreamFrame) InitialRequestN() uint32

InitialRequestN returns initial request N.

func (RequestStreamFrame) Len added in v0.7.0

func (f RequestStreamFrame) Len() int

Len returns length of frame.

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) RefCnt added in v0.7.0

func (f RequestStreamFrame) RefCnt() int32

func (RequestStreamFrame) Release added in v0.7.0

func (f RequestStreamFrame) Release()

Release releases resource.

func (RequestStreamFrame) StreamID added in v0.7.5

func (f RequestStreamFrame) StreamID() uint32

func (*RequestStreamFrame) Validate

func (r *RequestStreamFrame) Validate() error

Validate returns error if frame is invalid.

func (RequestStreamFrame) WriteTo added in v0.7.0

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

WriteTo write frame to writer.

type ResumeFrame

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

ResumeFrame is Resume frame.

func NewResumeFrame

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

NewResumeFrame creates a new ResumeFrame.

func (ResumeFrame) Body added in v0.7.0

func (f ResumeFrame) Body() []byte

Body returns frame body.

func (*ResumeFrame) FirstAvailableClientPosition

func (r *ResumeFrame) FirstAvailableClientPosition() uint64

FirstAvailableClientPosition returns first available client position.

func (ResumeFrame) HasFlag added in v0.7.0

func (f ResumeFrame) HasFlag(flag core.FrameFlag) bool

func (ResumeFrame) Header

func (f ResumeFrame) Header() core.FrameHeader

func (ResumeFrame) IncRef added in v0.7.0

func (f ResumeFrame) IncRef() int32

func (*ResumeFrame) LastReceivedServerPosition

func (r *ResumeFrame) LastReceivedServerPosition() uint64

LastReceivedServerPosition returns last received server position.

func (ResumeFrame) Len added in v0.7.0

func (f ResumeFrame) Len() int

Len returns length of frame.

func (ResumeFrame) RefCnt added in v0.7.0

func (f ResumeFrame) RefCnt() int32

func (ResumeFrame) Release added in v0.7.0

func (f ResumeFrame) Release()

Release releases resource.

func (ResumeFrame) StreamID added in v0.7.5

func (f ResumeFrame) StreamID() uint32

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.

func (ResumeFrame) WriteTo added in v0.7.0

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

WriteTo write frame to writer.

type ResumeOKFrame

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

ResumeOKFrame is ResumeOK frame.

func NewResumeOKFrame

func NewResumeOKFrame(position uint64) *ResumeOKFrame

NewResumeOKFrame creates a new ResumeOKFrame.

func (ResumeOKFrame) Body added in v0.7.0

func (f ResumeOKFrame) Body() []byte

Body returns frame body.

func (ResumeOKFrame) HasFlag added in v0.7.0

func (f ResumeOKFrame) HasFlag(flag core.FrameFlag) bool

func (ResumeOKFrame) Header

func (f ResumeOKFrame) Header() core.FrameHeader

func (ResumeOKFrame) IncRef added in v0.7.0

func (f ResumeOKFrame) IncRef() int32

func (*ResumeOKFrame) LastReceivedClientPosition

func (r *ResumeOKFrame) LastReceivedClientPosition() uint64

LastReceivedClientPosition returns last received client position.

func (ResumeOKFrame) Len added in v0.7.0

func (f ResumeOKFrame) Len() int

Len returns length of frame.

func (ResumeOKFrame) RefCnt added in v0.7.0

func (f ResumeOKFrame) RefCnt() int32

func (ResumeOKFrame) Release added in v0.7.0

func (f ResumeOKFrame) Release()

Release releases resource.

func (ResumeOKFrame) StreamID added in v0.7.5

func (f ResumeOKFrame) StreamID() uint32

func (*ResumeOKFrame) Validate

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

Validate validate current frame.

func (ResumeOKFrame) WriteTo added in v0.7.0

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

WriteTo write frame to writer.

type SetupFrame

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

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) Body added in v0.7.0

func (f SetupFrame) Body() []byte

Body returns frame body.

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() (data string)

DataUTF8 returns data as UTF8 string.

func (SetupFrame) HasFlag added in v0.7.0

func (f SetupFrame) HasFlag(flag core.FrameFlag) bool

func (SetupFrame) Header

func (f SetupFrame) Header() core.FrameHeader

func (SetupFrame) IncRef added in v0.7.0

func (f SetupFrame) IncRef() int32

func (SetupFrame) Len added in v0.7.0

func (f SetupFrame) Len() int

Len returns length of frame.

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) RefCnt added in v0.7.0

func (f SetupFrame) RefCnt() int32

func (SetupFrame) Release added in v0.7.0

func (f SetupFrame) Release()

Release releases resource.

func (SetupFrame) StreamID added in v0.7.5

func (f SetupFrame) StreamID() uint32

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.

func (SetupFrame) WriteTo added in v0.7.0

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

WriteTo write frame to writer.

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()

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

func (*WriteableCancelFrame) HandleDone added in v0.7.0

func (t *WriteableCancelFrame) HandleDone(h func())

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()

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

func (WriteableErrorFrame) Error

func (c WriteableErrorFrame) Error() string

func (WriteableErrorFrame) ErrorCode added in v0.7.0

func (c WriteableErrorFrame) ErrorCode() core.ErrorCode

func (WriteableErrorFrame) ErrorData added in v0.7.0

func (c WriteableErrorFrame) ErrorData() []byte

func (*WriteableErrorFrame) HandleDone added in v0.7.0

func (t *WriteableErrorFrame) HandleDone(h func())

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()

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

func (*WriteableFireAndForgetFrame) HandleDone added in v0.7.0

func (t *WriteableFireAndForgetFrame) HandleDone(h func())

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()

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

func (*WriteableKeepaliveFrame) HandleDone added in v0.7.0

func (t *WriteableKeepaliveFrame) HandleDone(h func())

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()

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

func (*WriteableLeaseFrame) HandleDone added in v0.7.0

func (t *WriteableLeaseFrame) HandleDone(h func())

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()

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

func (*WriteableMetadataPushFrame) HandleDone added in v0.7.0

func (t *WriteableMetadataPushFrame) HandleDone(h func())

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 (p *WriteablePayloadFrame) Done()

func (*WriteablePayloadFrame) HandleDone added in v0.7.0

func (t *WriteablePayloadFrame) HandleDone(h func())

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()

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

func (*WriteableRequestChannelFrame) HandleDone added in v0.7.0

func (t *WriteableRequestChannelFrame) HandleDone(h func())

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()

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

func (*WriteableRequestNFrame) HandleDone added in v0.7.0

func (t *WriteableRequestNFrame) HandleDone(h func())

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 NewWriteableRequestResponseFrame

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

NewWriteableRequestResponseFrame returns a new WriteableRequestResponseFrame.

func (*WriteableRequestResponseFrame) Done

func (*WriteableRequestResponseFrame) HandleDone added in v0.7.0

func (t *WriteableRequestResponseFrame) HandleDone(h func())

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 NewWriteableRequestStreamFrame

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

NewWriteableRequestStreamFrame creates a new WriteableRequestStreamFrame.

func (*WriteableRequestStreamFrame) Done

func (t *WriteableRequestStreamFrame) Done()

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

func (*WriteableRequestStreamFrame) HandleDone added in v0.7.0

func (t *WriteableRequestStreamFrame) HandleDone(h func())

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 uint64,
	lastReceivedServerPosition uint64,
) *WriteableResumeFrame

NewWriteableResumeFrame creates a new WriteableResumeFrame.

func (*WriteableResumeFrame) Done

func (t *WriteableResumeFrame) Done()

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

func (*WriteableResumeFrame) HandleDone added in v0.7.0

func (t *WriteableResumeFrame) HandleDone(h func())

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()

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

func (*WriteableResumeOKFrame) HandleDone added in v0.7.0

func (t *WriteableResumeOKFrame) HandleDone(h func())

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()

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

func (*WriteableSetupFrame) HandleDone added in v0.7.0

func (t *WriteableSetupFrame) HandleDone(h func())

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