Documentation
¶
Overview ¶
Code generated by gowebx, DO AVOID EDIT.
Code generated by gowebx, DO AVOID EDIT.
Code generated by gowebx, DO AVOID EDIT.
Code generated by gowebx, DO AVOID EDIT.
Code generated by gowebx, DO AVOID EDIT.
Code generated by gowebx, DO AVOID EDIT.
Code generated by gowebx, DO AVOID EDIT.
Code generated by gowebx, DO AVOID EDIT.
Index ¶
- type AddChannelInput
- type AddDeviceInput
- type Channel
- type ChannelStorer
- type Core
- func (c *Core) AddChannel(ctx context.Context, in *AddChannelInput) (*Channel, error)
- func (c Core) AddDevice(ctx context.Context, in *AddDeviceInput) (*Device, error)
- func (c *Core) DelChannel(ctx context.Context, id string) (*Channel, error)
- func (c Core) DelDevice(ctx context.Context, id string) (*Device, error)
- func (c *Core) EditChannel(ctx context.Context, in *EditChannelInput, id string) (*Channel, error)
- func (c Core) EditDevice(ctx context.Context, in *EditDeviceInput, id string) (*Device, error)
- func (c *Core) FindChannel(ctx context.Context, in *FindChannelInput) ([]*Channel, int64, error)
- func (c Core) FindDevice(ctx context.Context, in *FindDeviceInput) ([]*Device, int64, error)
- func (c *Core) GetChannel(ctx context.Context, id string) (*Channel, error)
- func (c Core) GetDevice(ctx context.Context, id string) (*Device, error)
- func (c Core) GetDeviceByDeviceID(ctx context.Context, deviceID string) (*Device, error)
- type Device
- type DeviceExt
- type DeviceStorer
- type EditChannelInput
- type EditDeviceInput
- type FindChannelInput
- type FindDeviceInput
- type GB28181
- func (g GB28181) Edit(deviceID string, changeFn func(*Device)) error
- func (g GB28181) FindDevices(ctx context.Context) ([]*Device, error)
- func (g GB28181) GetDeviceByDeviceID(deviceID string) (*Device, error)
- func (g GB28181) Login(deviceID string, changeFn func(*Device)) error
- func (g GB28181) Logout(deviceID string, changeFn func(*Device)) error
- func (g GB28181) SaveChannels(channels []*Channel) error
- type Storer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AddChannelInput ¶
type AddDeviceInput ¶
type Channel ¶
type Channel struct { ID string `gorm:"primaryKey" json:"id"` DeviceID string `gorm:"column:device_id;index;notNull;default:'';comment:国标编码" json:"device_id"` // 国标编码 ChannelID string `gorm:"column:channel_id;index;notNull;default:'';comment:国标编码" json:"channel_id"` // 国标编码 Name string `gorm:"column:name;notNull;default:'';comment:通道名称" json:"name"` // 通道名称 PTZType int `gorm:"column:ptztype;notNull;default:0;comment:云台类型" json:"ptztype"` // 云台类型 IsOnline bool `gorm:"column:is_online;notNull;default:FALSE;comment:是否在线" json:"is_online"` // 是否在线 Ext DeviceExt `gorm:"column:ext;notNull;default:'{}';type:jsonb" json:"ext"` }
Channel domain model
type ChannelStorer ¶
type ChannelStorer interface { Find(context.Context, *[]*Channel, orm.Pager, ...orm.QueryOption) (int64, error) Get(context.Context, *Channel, ...orm.QueryOption) error Add(context.Context, *Channel) error Edit(context.Context, *Channel, func(*Channel), ...orm.QueryOption) error Del(context.Context, *Channel, ...orm.QueryOption) error }
ChannelStorer Instantiation interface
type Core ¶
type Core struct {
// contains filtered or unexported fields
}
Core business domain
func (*Core) AddChannel ¶
AddChannel Insert into database
func (*Core) DelChannel ¶
DelChannel Delete object
func (*Core) EditChannel ¶
EditChannel Update object information
func (Core) EditDevice ¶
EditDevice Update object information
func (*Core) FindChannel ¶
FindChannel Paginated search
func (Core) FindDevice ¶
FindDevice Paginated search
func (*Core) GetChannel ¶
GetChannel Query a single object
type Device ¶
type Device struct { ID string `gorm:"primaryKey" json:"id"` DeviceID string `gorm:"column:device_id;notNull;uniqueIndex;default:'';comment:20 位国标编号" json:"device_id"` // 20 位国标编号 Name string `gorm:"column:name;notNull;default:'';comment:设备名称" json:"name"` // 设备名称 Trasnport string `gorm:"column:trasnport;notNull;default:'';comment:传输协议(tcp/udp)" json:"trasnport"` // 传输协议(TCP/UDP) StreamMode int8 `gorm:"column:stream_mode;notNull;default:0;comment:数据传输模式(0:UDP; 1:TCP_PASSIVE; 2:TCP_ACTIVE)" json:"stream_mode"` // 数据传输模式 IP string `gorm:"column:ip;notNull;default:''" json:"ip"` Port int `gorm:"column:port;notNull;default:0" json:"port"` IsOnline bool `gorm:"column:is_online;notNull;default:FALSE" json:"is_online"` RegisteredAt orm.Time `gorm:"column:registered_at;notNull;default:CURRENT_TIMESTAMP;comment:注册时间" json:"registered_at"` // 注册时间 KeepaliveAt orm.Time `gorm:"column:keepalive_at;notNull;default:CURRENT_TIMESTAMP;comment:心跳时间" json:"keepalive_at"` // 心跳时间 Keepalives int `gorm:"column:keepalives;notNull;default:0;comment:心跳间隔" json:"keepalives"` // 心跳间隔 Expires int `gorm:"column:expires;notNull;default:0;comment:注册有效期" json:"expires"` // 注册有效期 Channels int `gorm:"column:channels;notNull;default:0;comment:通道数量" json:"channels"` // 通道数量 CreatedAt orm.Time `gorm:"column:created_at;notNull;default:CURRENT_TIMESTAMP;comment:创建时间" json:"created_at"` // 创建时间 UpdatedAt orm.Time `gorm:"column:updated_at;notNull;default:CURRENT_TIMESTAMP;comment:更新时间" json:"updated_at"` // 更新时间 Password string `gorm:"column:password;notNull;default:'';comment:注册密码" json:"password"` Address string `gorm:"column:address;notNull;default:'';comment:设备网络地址" json:"address"` Ext DeviceExt `gorm:"column:ext;notNull;default:'{}';type:jsonb;comment:设备属性" json:"ext"` // 设备属性 }
Device domain model
func (*Device) NetworkAddress ¶
type DeviceExt ¶
type DeviceExt struct { Manufacturer string `json:"manufacturer"` // 生产厂商 Model string `json:"model"` // 型号 Firmware string `json:"firmware"` // 固件版本 Name string `json:"name"` // 设备名 }
DeviceExt domain model
type DeviceStorer ¶
type DeviceStorer interface { Find(context.Context, *[]*Device, orm.Pager, ...orm.QueryOption) (int64, error) Get(context.Context, *Device, ...orm.QueryOption) error Add(context.Context, *Device) error Edit(context.Context, *Device, func(*Device), ...orm.QueryOption) error Del(context.Context, *Device, ...orm.QueryOption) error }
DeviceStorer Instantiation interface
type EditChannelInput ¶
type EditDeviceInput ¶
type FindChannelInput ¶
type FindChannelInput struct { web.PagerFilter DeviceID string `form:"device_id"` // 国标编码 Key string `form:"key"` // 名称/国标编码 模糊搜索,id 精确搜索 // Name string `form:"name"` // 通道名称 // PTZType int `form:"ptztype"` // 云台类型 IsOnline bool `form:"is_online"` // 是否在线 }
type FindDeviceInput ¶
type FindDeviceInput struct { web.PagerFilter Key string `form:"key"` }
type GB28181 ¶
type GB28181 struct {
// contains filtered or unexported fields
}
func NewGB28181 ¶
func NewGB28181(ds DeviceStorer, cs ChannelStorer, uni uniqueid.Core) GB28181
func (GB28181) FindDevices ¶
FindDevices 获取所有设备
func (GB28181) GetDeviceByDeviceID ¶
func (GB28181) SaveChannels ¶
type Storer ¶
type Storer interface { Device() DeviceStorer Channel() ChannelStorer }
Storer data persistence