def

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2023 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OrderAes  = iota //从久到近排序
	OrderDesc        //时间从近到久排序
)
View Source
const (
	GatewayBind   = 1 //绑定
	GatewayUnbind = 2 //解绑
)
View Source
const (
	True  = 1 //是
	False = 2 //否
)
View Source
const (
	Enable  = 1 //启用
	Disable = 2 //禁用
)
View Source
const DeviceGroupLevel = 3
View Source
const Unknown = 0

Variables

This section is empty.

Functions

func ToBool

func ToBool[boolType constraints.Integer](in boolType) bool

func ToIntBool

func ToIntBool[boolType constraints.Integer](in bool) boolType

Types

type AuthMode

type AuthMode = int64
const (
	AuthModePwd  AuthMode = 1 //账密认证
	AuthModeCert AuthMode = 2 //证书认证
)

type AutoReg

type AutoReg = int64
const (
	AutoRegClose AutoReg = 1 //关闭
	AutoRegOpen  AutoReg = 2 //打开
	AutoRegAuto  AutoReg = 3 //打开并自动创建设备
)

type DataProto

type DataProto = int64
const (
	DataProtoCustom   DataProto = 1 //自定义
	DataProtoTemplate DataProto = 2 //数据模板
)

type DeviceStatus added in v0.3.0

type DeviceStatus = int64
const (
	DeviceStatusInactive DeviceStatus = 0 // 未激活
	DeviceStatusOnline   DeviceStatus = 1 //在线
	DeviceStatusOffline  DeviceStatus = 2 //离线
)

type DeviceType

type DeviceType = int64
const (
	DeviceTypeDevice  DeviceType = 1 //设备
	DeviceTypeGateway DeviceType = 2 //网关
	DeviceTypeSubset  DeviceType = 3 //子设备
)

type LogLevel

type LogLevel = int64
const (
	LogClose LogLevel = 1 //关闭
	LogError LogLevel = 2 //错误
	LogWarn  LogLevel = 3 //告警
	LogInfo  LogLevel = 4 //信息
	LogDebug LogLevel = 5 //调试
)

type Net

type Net = int64
const (
	NetOther Net = 1 //其他
	NetWifi  Net = 2 //wi-fi
	NetG234  Net = 3 //2G/3G/4G
	NetG5    Net = 4 //5G
	NetBle   Net = 5 //蓝牙
	NetLora  Net = 6 //LoRaWAN
)

type Opt

type Opt = int64
const (
	OptAdd    Opt = 0 //增加
	OptModify Opt = 1 //修改
	OptDel    Opt = 2 //删除
)

type PageInfo

type PageInfo struct {
	Page int64 `json:"page" form:"page"`         // 页码
	Size int64 `json:"pageSize" form:"pageSize"` // 每页大小
}

func (*PageInfo) GetLimit

func (p *PageInfo) GetLimit() int64

func (*PageInfo) GetOffset

func (p *PageInfo) GetOffset() int64

type PageInfo2

type PageInfo2 struct {
	TimeStart int64 `json:"timeStart"`
	TimeEnd   int64 `json:"timeEnd"`
	Page      int64 `json:"page" form:"page"` // 页码
	Size      int64 `json:"size" form:"size"` // 每页大小
}

func (PageInfo2) FmtSql

func (p PageInfo2) FmtSql(sql sq.SelectBuilder) sq.SelectBuilder

func (PageInfo2) FmtWhere

func (p PageInfo2) FmtWhere(sql sq.SelectBuilder) sq.SelectBuilder

func (PageInfo2) GetLimit

func (p PageInfo2) GetLimit() int64

func (PageInfo2) GetOffset

func (p PageInfo2) GetOffset() int64

func (PageInfo2) GetTimeEnd

func (p PageInfo2) GetTimeEnd() time.Time

func (PageInfo2) GetTimeStart

func (p PageInfo2) GetTimeStart() time.Time

type TimeRange added in v0.4.1

type TimeRange struct {
	Start int64
	End   int64
}

func (TimeRange) FmtSql added in v0.4.1

func (t TimeRange) FmtSql(sql sq.SelectBuilder) sq.SelectBuilder

Jump to

Keyboard shortcuts

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