Documentation ¶
Index ¶
- Constants
- func ValidSequenceNumber(oldValue, newValue uint32, lastEventOccurs time.Time, now time.Time) bool
- type Client
- type DoFunc
- type Handler
- func (h *Handler[C]) GetObservation(key uint64) (*Observation[C], bool)
- func (h *Handler[C]) GetObservationRequest(token message.Token) (*pool.Message, bool)
- func (h *Handler[C]) Handle(w *responsewriter.ResponseWriter[C], r *pool.Message)
- func (h *Handler[C]) NewObservation(req *pool.Message, observeFunc func(req *pool.Message)) (*Observation[C], error)
- type HandlerFunc
- type Observation
Constants ¶
View Source
const ObservationSequenceTimeout = 128 * time.Second
ObservationSequenceTimeout defines how long is sequence number is valid. https://tools.ietf.org/html/rfc7641#section-3.4
Variables ¶
This section is empty.
Functions ¶
func ValidSequenceNumber ¶
ValidSequenceNumber implements conditions in https://tools.ietf.org/html/rfc7641#section-3.4
Types ¶
type Handler ¶
type Handler[C Client] struct { // contains filtered or unexported fields }
func NewHandler ¶
func NewHandler[C Client](cc C, next HandlerFunc[C], do DoFunc) *Handler[C]
func (*Handler[C]) GetObservation ¶
func (h *Handler[C]) GetObservation(key uint64) (*Observation[C], bool)
func (*Handler[C]) GetObservationRequest ¶
GetObservationRequest returns observation request for token
func (*Handler[C]) Handle ¶
func (h *Handler[C]) Handle(w *responsewriter.ResponseWriter[C], r *pool.Message)
func (*Handler[C]) NewObservation ¶
type HandlerFunc ¶
type HandlerFunc[C Client] func(*responsewriter.ResponseWriter[C], *pool.Message)
The HandlerFunc type is an adapter to allow the use of ordinary functions as COAP handlers.
type Observation ¶
type Observation[C Client] struct { // contains filtered or unexported fields }
Observation represents subscription to resource on the server
func (*Observation[C]) Cancel ¶
Cancel remove observation from server. For recreate observation use Observe.
func (*Observation[C]) Canceled ¶
func (o *Observation[C]) Canceled() bool
func (*Observation[C]) Request ¶
func (o *Observation[C]) Request() message.Message
Click to show internal directories.
Click to hide internal directories.