online

package
v0.9.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 15, 2015 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

package online manage device online state and store it in redis.

Index

Constants

View Source
const (
	OnlineStatusKeyPrefix = "device:onlinestatus:"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

func NewManager

func NewManager(host string) *Manager

func (*Manager) GetOffline

func (mgr *Manager) GetOffline(id uint64) error

func (*Manager) GetOnline

func (mgr *Manager) GetOnline(id uint64, status Status) error

func (*Manager) GetStatus

func (mgr *Manager) GetStatus(id uint64) (*Status, error)

func (*Manager) SetHeartbeat

func (mgr *Manager) SetHeartbeat(id uint64) error

type Status

type Status struct {
	ClientIP          string
	AccessRPCHost     string
	HeartbeatInterval uint32
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL