Documentation ¶
Index ¶
- func SetEnv(value *Env)
- type Env
- func (env *Env) CoapContext() *libcoap.Context
- func (env *Env) EventChannel() chan Event
- func (env *Env) HandleResponse(session *libcoap.Session, pdu *libcoap.Pdu)
- func (env *Env) HandleTimeout(session *libcoap.Session, sent *libcoap.Pdu)
- func (env *Env) HeartBeatMechaism(session *libcoap.Session, customer *models.Customer)
- func (env *Env) RemoveSession(session *libcoap.Session)
- func (env *Env) RenewEnv(context *libcoap.Context, currentSession *libcoap.Session) *Env
- func (env *Env) Run(session *libcoap.Session, task Task)
- type Event
- type EventBase
- type HeartBeatEvent
- type HeartBeatMessageTask
- type HeartBeatResponseHandler
- type HeartBeatTimeoutHandler
- type Task
- type TaskBase
- type TimeoutEvent
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Env ¶
type Env struct {
// contains filtered or unexported fields
}
func NewEnv ¶
* Env constructor * parameter: * context the signal context * return: * env the new env
func (*Env) CoapContext ¶
* Get env context * return: * context the context
func (*Env) EventChannel ¶
* Get env event * return: * channel the event
func (*Env) HandleResponse ¶
func (*Env) HandleTimeout ¶
func (*Env) HeartBeatMechaism ¶
Handle heartbeat from server to client
func (*Env) RemoveSession ¶
Remove session in env
type HeartBeatEvent ¶
type HeartBeatEvent struct{ EventBase }
func (*HeartBeatEvent) Handle ¶
func (e *HeartBeatEvent) Handle(env *Env)
type HeartBeatMessageTask ¶
type HeartBeatMessageTask struct { TaskBase // contains filtered or unexported fields }
func NewHeartBeatMessageTask ¶
func NewHeartBeatMessageTask(message *libcoap.Pdu, retry int, timeout time.Duration, interval time.Duration, responseHandler HeartBeatResponseHandler, timeoutHandler HeartBeatTimeoutHandler) *HeartBeatMessageTask
type HeartBeatResponseHandler ¶
type HeartBeatResponseHandler func(*HeartBeatMessageTask, *libcoap.Pdu)
type HeartBeatTimeoutHandler ¶
type HeartBeatTimeoutHandler func(*HeartBeatMessageTask, *Env)
type TimeoutEvent ¶
type TimeoutEvent struct{ EventBase }
func (*TimeoutEvent) Handle ¶
func (e *TimeoutEvent) Handle(env *Env)
Click to show internal directories.
Click to hide internal directories.