Documentation ¶
Index ¶
Constants ¶
View Source
const ( // DefaultKeepaliveInterval is default keepalive interval duration. DefaultKeepaliveInterval = 20 * time.Second // DefaultKeepaliveMaxLifetime is default keepalive max lifetime. DefaultKeepaliveMaxLifetime = 90 * time.Second )
View Source
const MaxUint24 = 16777215
MaxUint24 is the max value of Uint24.
Variables ¶
View Source
var ( ErrFrameLengthExceed = errors.New("rsocket: frame length is greater than 24bits") ErrInvalidTransport = errors.New("rsocket: invalid Transport") ErrInvalidFrame = errors.New("rsocket: invalid frame") ErrInvalidContext = errors.New("rsocket: invalid context") ErrInvalidFrameLength = errors.New("rsocket: invalid frame length") ErrReleasedResource = errors.New("rsocket: resource has been released") ErrInvalidEmitter = errors.New("rsocket: invalid emitter") ErrHandlerNil = errors.New("rsocket: handler cannot be nil") ErrHandlerExist = errors.New("rsocket: handler exists already") ErrSendFull = errors.New("rsocket: frame send channel is full") )
Error defines.
Functions ¶
func RandAlphabetic ¶
RandAlphabetic returns a string with random alphabets.
func RandAlphanumeric ¶
RandAlphanumeric returns a string with random alphabets and numbers.
Types ¶
type ByteBuff ¶
ByteBuff provides byte buffer, which can be used for minimizing.
func (*ByteBuff) WriteUint24 ¶
WriteUint24 encode and write Uint24 to current ByteBuff.
type CustomError ¶ added in v0.5.11
type CustomError interface { error // ErrorCode returns error code. ErrorCode() ErrorCode // ErrorData returns error data bytes. ErrorData() []byte }
CustomError provides a method of accessing code and data.
type ErrorCode ¶
type ErrorCode uint32
ErrorCode is code for RSocket error.
const ( // ErrorCodeInvalidSetup means the setup frame is invalid for the server. ErrorCodeInvalidSetup ErrorCode = 0x00000001 // ErrorCodeUnsupportedSetup means some (or all) of the parameters specified by the client are unsupported by the server. ErrorCodeUnsupportedSetup ErrorCode = 0x00000002 // ErrorCodeRejectedSetup means server rejected the setup, it can specify the reason in the payload. ErrorCodeRejectedSetup ErrorCode = 0x00000003 // ErrorCodeRejectedResume means server rejected the resume, it can specify the reason in the payload. ErrorCodeRejectedResume ErrorCode = 0x00000004 // ErrorCodeConnectionError means the connection is being terminated. ErrorCodeConnectionError ErrorCode = 0x00000101 // ErrorCodeConnectionClose means the connection is being terminated. ErrorCodeConnectionClose ErrorCode = 0x00000102 // ErrorCodeApplicationError means application layer logic generating a Reactive Streams onError event. ErrorCodeApplicationError ErrorCode = 0x00000201 // ErrorCodeRejected means Responder reject it. ErrorCodeRejected ErrorCode = 0x00000202 // ErrorCodeCanceled means the Responder canceled the request but may have started processing it (similar to REJECTED but doesn't guarantee lack of side-effects). ErrorCodeCanceled ErrorCode = 0x00000203 // ErrorCodeInvalid means the request is invalid. ErrorCodeInvalid ErrorCode = 0x00000204 )
type Uint24 ¶
type Uint24 [3]byte
Uint24 is 3 bytes unsigned integer.
func NewUint24Bytes ¶
NewUint24Bytes returns a new uint24 from bytes.
Click to show internal directories.
Click to hide internal directories.