Documentation
¶
Index ¶
- type Client
- type ResponseWriter
- func (r *ResponseWriter[C]) Conn() C
- func (r *ResponseWriter[C]) Message() *pool.Message
- func (r *ResponseWriter[C]) SetMessage(m *pool.Message)
- func (r *ResponseWriter[C]) SetResponse(code codes.Code, contentFormat message.MediaType, d io.ReadSeeker, ...) error
- func (r *ResponseWriter[C]) Swap(m *pool.Message) *pool.Message
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ResponseWriter ¶
type ResponseWriter[C Client] struct { // contains filtered or unexported fields }
A ResponseWriter is used by an COAP handler to construct an COAP response.
func (*ResponseWriter[C]) Message ¶
func (r *ResponseWriter[C]) Message() *pool.Message
Message direct access to the response.
func (*ResponseWriter[C]) SetMessage ¶
func (r *ResponseWriter[C]) SetMessage(m *pool.Message)
SetMessage replaces the response message. The original message was released to the message pool, so don't use it any more. Ensure that Token, MessageID(udp), and Type(udp) messages are paired correctly.
func (*ResponseWriter[C]) SetResponse ¶
func (r *ResponseWriter[C]) SetResponse(code codes.Code, contentFormat message.MediaType, d io.ReadSeeker, opts ...message.Option) error
SetResponse simplifies the setup of the response for the request. ETags must be set via options. For advanced setup, use Message().
Click to show internal directories.
Click to hide internal directories.