Documentation
¶
Index ¶
- type Decoder
- type Encoder
- type Message
- func (r *Message) Accept() (message.MediaType, error)
- func (r *Message) AddETag(value []byte) error
- func (r *Message) AddOptionBytes(opt message.OptionID, value []byte)
- func (r *Message) AddOptionString(opt message.OptionID, value string)
- func (r *Message) AddOptionUint32(opt message.OptionID, value uint32)
- func (r *Message) AddQuery(query string)
- func (r *Message) Body() io.ReadSeeker
- func (r *Message) BodySize() (int64, error)
- func (r *Message) Clone(msg *Message) error
- func (r *Message) Code() codes.Code
- func (r *Message) ContentFormat() (message.MediaType, error)
- func (r *Message) Context() context.Context
- func (r *Message) ETag() ([]byte, error)
- func (r *Message) ETags(b [][]byte) (int, error)
- func (r *Message) GetOptionAllBytes(id message.OptionID, b [][]byte) (int, error)
- func (r *Message) GetOptionBytes(id message.OptionID) ([]byte, error)
- func (r *Message) GetOptionUint32(id message.OptionID) (uint32, error)
- func (r *Message) HasOption(id message.OptionID) bool
- func (r *Message) Hijack()
- func (r *Message) IsHijacked() bool
- func (r *Message) IsModified() bool
- func (r *Message) IsSeparateMessage() bool
- func (r *Message) MarshalWithEncoder(encoder Encoder) ([]byte, error)
- func (r *Message) MessageID() int32
- func (r *Message) MustSetPath(p string)
- func (r *Message) Observe() (uint32, error)
- func (r *Message) Options() message.Options
- func (r *Message) Path() (string, error)
- func (r *Message) Queries() ([]string, error)
- func (r *Message) ReadBody() ([]byte, error)
- func (r *Message) Remove(opt message.OptionID)
- func (r *Message) Reset()
- func (r *Message) ResetOptionsTo(in message.Options)
- func (r *Message) Sequence() uint64
- func (r *Message) SetAccept(contentFormat message.MediaType)
- func (r *Message) SetBody(s io.ReadSeeker)
- func (r *Message) SetCode(code codes.Code)
- func (r *Message) SetContentFormat(contentFormat message.MediaType)
- func (r *Message) SetContext(ctx context.Context)
- func (r *Message) SetETag(value []byte) error
- func (r *Message) SetMessage(message message.Message)
- func (r *Message) SetMessageID(mid int32)
- func (r *Message) SetModified(b bool)
- func (r *Message) SetObserve(observe uint32)
- func (r *Message) SetOptionBytes(opt message.OptionID, value []byte)
- func (r *Message) SetOptionString(opt message.OptionID, value string)
- func (r *Message) SetOptionUint32(opt message.OptionID, value uint32)
- func (r *Message) SetPath(p string) error
- func (r *Message) SetSequence(seq uint64)
- func (r *Message) SetToken(token message.Token)
- func (r *Message) SetType(typ message.Type)
- func (r *Message) SetupDelete(path string, token message.Token, opts ...message.Option) error
- func (r *Message) SetupGet(path string, token message.Token, opts ...message.Option) error
- func (r *Message) SetupPost(path string, token message.Token, contentFormat message.MediaType, ...) error
- func (r *Message) SetupPut(path string, token message.Token, contentFormat message.MediaType, ...) error
- func (r *Message) String() string
- func (r *Message) Token() message.Token
- func (r *Message) Type() message.Type
- func (r *Message) UnmarshalWithDecoder(decoder Decoder, data []byte) (int, error)
- func (r *Message) UpsertMessageID(mid int32)
- func (r *Message) UpsertType(typ message.Type)
- type Pool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Message ¶
type Message struct {
// contains filtered or unexported fields
}
func NewMessage ¶
func (*Message) AddETag ¶
AddETag appends value to existing ETags.
Option definition: - format: opaque, length: 1-8, repeatable
func (*Message) AddOptionBytes ¶
func (*Message) AddOptionString ¶
func (*Message) AddOptionUint32 ¶
func (*Message) Body ¶
func (r *Message) Body() io.ReadSeeker
func (*Message) ETags ¶
ETags returns all ETag values
Writes ETag values to output array, returns number of written values or error.
func (*Message) GetOptionAllBytes ¶
GetOptionAllBytes gets array of bytes of all options with given ID.
func (*Message) GetOptionBytes ¶
GetOptionBytes gets bytes of the first option with given ID.
func (*Message) GetOptionUint32 ¶
func (*Message) IsHijacked ¶
func (*Message) IsModified ¶
func (*Message) IsSeparateMessage ¶
func (*Message) MarshalWithEncoder ¶
func (*Message) MustSetPath ¶
MustSetPath calls SetPath and panics if it returns an error.
func (*Message) ResetOptionsTo ¶
func (*Message) SetBody ¶
func (r *Message) SetBody(s io.ReadSeeker)
func (*Message) SetContentFormat ¶
func (*Message) SetContext ¶
func (*Message) SetETag ¶
SetETag inserts/replaces ETag option(s).
After a successful call only a single ETag value will remain.
func (*Message) SetMessage ¶
func (*Message) SetMessageID ¶
SetMessageID only 0 to 2^16-1 are valid.
func (*Message) SetModified ¶
func (*Message) SetObserve ¶
func (*Message) SetOptionBytes ¶
func (*Message) SetOptionString ¶
func (*Message) SetOptionUint32 ¶
func (*Message) SetPath ¶
SetPath stores the given path within URI-Path options.
The value is stored by the algorithm described in RFC7252 and using the internal buffer. If the path is too long, but valid (URI-Path segments must have maximal length of 255) the internal buffer is expanded. If the path is too long, but not valid then the function returns ErrInvalidValueLength error.
func (*Message) SetSequence ¶
func (*Message) SetupDelete ¶
func (*Message) UnmarshalWithDecoder ¶
func (*Message) UpsertMessageID ¶
UpsertMessageID set value only when origin value is invalid. Only 0 to 2^16-1 values are valid.
func (*Message) UpsertType ¶
UpsertType set value only when origin value is invalid. Only 0 to 2^8-1 values are valid.
type Pool ¶
type Pool struct {
// contains filtered or unexported fields
}
func (*Pool) AcquireMessage ¶
AcquireMessage returns an empty Message instance from Message pool.
The returned Message instance may be passed to ReleaseMessage when it is no longer needed. This allows Message recycling, reduces GC pressure and usually improves performance.
func (*Pool) ReleaseMessage ¶
ReleaseMessage returns req acquired via AcquireMessage to Message pool.
It is forbidden accessing req and/or its' members after returning it to Message pool.