Documentation ¶
Index ¶
- Constants
- Variables
- func CacheSegment(seg *model.Segment) bool
- func ClearSession(id string)
- func GetSession(id string) (*model.Session, error)
- func StoreSession(s *model.Session)
- type DeviceCache
- func (cache *DeviceCache) CacheDevice(d *model.Device)
- func (cache *DeviceCache) DelDeviceByCarPlate(carPlate string)
- func (cache *DeviceCache) DelDeviceByPhone(phone string)
- func (cache *DeviceCache) GetDeviceByPhone(phone string) (*model.Device, error)
- func (cache *DeviceCache) GetDeviceByPlate(carPlate string) (*model.Device, error)
- func (cache *DeviceCache) HasPhone(phone string) bool
- func (cache *DeviceCache) HasPlate(carPlate string) bool
- func (cache *DeviceCache) ListDevice() []*model.Device
- type DeviceParamsCache
- type GeoCache
- type SegmentCache
- type SessionCache
Constants ¶
View Source
const RingCapacity int32 = 100
Variables ¶
View Source
var ErrDeviceNotFound = errors.New("device not found")
View Source
var ErrDeviceParamsNotFound = errors.New("device params not found")
View Source
var ErrGisNotFound = errors.New("gis not found")
View Source
var ErrSessionClosed = errors.New("session closed")
Functions ¶
func CacheSegment ¶ added in v0.3.2
func GetSession ¶
通过id获取session。如果不存在,返回ErrSessionClosed(正常情况不会出现关闭session后还来获取session)
Types ¶
type DeviceCache ¶
type DeviceCache struct {
// contains filtered or unexported fields
}
func GetDeviceCache ¶
func GetDeviceCache() *DeviceCache
func (*DeviceCache) CacheDevice ¶
func (cache *DeviceCache) CacheDevice(d *model.Device)
func (*DeviceCache) DelDeviceByCarPlate ¶
func (cache *DeviceCache) DelDeviceByCarPlate(carPlate string)
func (*DeviceCache) DelDeviceByPhone ¶
func (cache *DeviceCache) DelDeviceByPhone(phone string)
func (*DeviceCache) GetDeviceByPhone ¶
func (cache *DeviceCache) GetDeviceByPhone(phone string) (*model.Device, error)
func (*DeviceCache) GetDeviceByPlate ¶
func (cache *DeviceCache) GetDeviceByPlate(carPlate string) (*model.Device, error)
func (*DeviceCache) HasPhone ¶
func (cache *DeviceCache) HasPhone(phone string) bool
func (*DeviceCache) HasPlate ¶
func (cache *DeviceCache) HasPlate(carPlate string) bool
func (*DeviceCache) ListDevice ¶
func (cache *DeviceCache) ListDevice() []*model.Device
type DeviceParamsCache ¶
type DeviceParamsCache struct {
// contains filtered or unexported fields
}
func GetDeviceParamsCache ¶
func GetDeviceParamsCache() *DeviceParamsCache
func (*DeviceParamsCache) CacheDeviceParams ¶
func (cache *DeviceParamsCache) CacheDeviceParams(d *model.DeviceParams)
func (*DeviceParamsCache) DelDeviceParamsByPhone ¶
func (cache *DeviceParamsCache) DelDeviceParamsByPhone(phone string)
func (*DeviceParamsCache) GetDeviceParamsByPhone ¶
func (cache *DeviceParamsCache) GetDeviceParamsByPhone(phone string) (*model.DeviceParams, error)
type GeoCache ¶
type GeoCache struct {
// contains filtered or unexported fields
}
func GetGeoCache ¶
func GetGeoCache() *GeoCache
func (*GeoCache) DelGeoByPhone ¶
func (*GeoCache) GetGeoLatestByPhone ¶
func (*GeoCache) GetGeoRingByPhone ¶
func (cache *GeoCache) GetGeoRingByPhone(phone string) *container.RingBuffer
type SegmentCache ¶ added in v0.3.2
type SegmentCache struct {
// contains filtered or unexported fields
}
type SessionCache ¶
type SessionCache struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.