Documentation ¶
Index ¶
- Variables
- type Channel
- type DevResponse
- type Device
- type DeviceAccessToken
- type DeviceHistoryItem
- type DeviceKey
- type LiveRequest
- type LiveResponse
- type M
- type Manager
- func (manager *Manager) AddDevice(appid string, dev *Device) (*Device, error)
- func (manager *Manager) AddDeviceKey(appid, device string) ([]DeviceKey, error)
- func (manager *Manager) CloneDeviceKey(appid, fromdevice, todevice string, cleanSelfKeys, deleteDevice bool, ...) ([]DeviceKey, error)
- func (manager *Manager) DeleteDevice(appid, device string) error
- func (manager *Manager) DeleteDeviceKey(appid, device, dak string) error
- func (manager *Manager) ListDevice(appid, prefix, marker string, limit int, online, status bool, deviceType int, ...) ([]Device, string, error)
- func (manager *Manager) ListDeviceHistoryactivity(appid, dev string, start, end int, marker string, limit int) ([]DeviceHistoryItem, string, error)
- func (manager *Manager) QueryAppidDeviceNameByAccessKey(dak string) (string, string, error)
- func (manager *Manager) QueryDevice(appid, device string) (*Device, error)
- func (manager *Manager) QueryDeviceKey(appid, device string) ([]DeviceKey, error)
- func (manager *Manager) RPC(appid, device string, req *RpcRequest) (*RpcResponse, error)
- func (manager *Manager) Saveas(appid, device string, start, end int, fname, format string) (*SaveasReply, error)
- func (manager *Manager) Segments(appid, device string, start, end int, marker string, limit int) ([]Segment, string, error)
- func (manager *Manager) StartLive(req *LiveRequest) (*LiveResponse, error)
- func (manager *Manager) Stat(req *StatReq) ([]M, error)
- func (manager *Manager) StatusToken(appid, device string, deadline int64) (string, error)
- func (manager *Manager) Token(appid, device string, deadline int64, actions []Statement) (string, error)
- func (manager *Manager) UpdateDevice(appid, device string, ops []PatchOperation) (*Device, error)
- func (manager *Manager) UpdateDeviceKeyState(appid, device, dak string, state int) error
- func (manager *Manager) VodToken(appid, device string, deadline int64) (string, error)
- type PatchOperation
- type PlayUrls
- type RpcRequest
- type RpcResponse
- type SaveasReply
- type Segment
- type StatReq
- type Statement
Constants ¶
This section is empty.
Variables ¶
View Source
var APIHTTPScheme = "http://"
APIHTTPScheme 指定了在请求 API 服务器时使用的 HTTP 模式.
View Source
var APIHost = "linking.qiniuapi.com/v1"
APIHost 指定了 API 服务器的地址
Functions ¶
This section is empty.
Types ¶
type DevResponse ¶
type DevResponse struct { ErrorCode int `json:"errorCode,omitempty"` Error string `json:"error,omitempty"` Value json.RawMessage `json:"value,omitempty"` }
type Device ¶
type Device struct { Device string `json:"device"` LoginAt int64 `json:"loginAt,omitempty"` // 查询条件 online 为 true 时才会出现该字段 RemoteIp string `json:"remoteIp,omitempty"` // 查询条件 online 为 true 时才会出现该字段 // 0 不录制 // -1 永久 // -2 继承app配置 SegmentExpireDays int `json:"segmentExpireDays,has,omitempty"` // -1 继承app配置 // 0 遵循设备端配置 // 1 强制持续上传 // 2 强制关闭上传 UploadMode int `json:"uploadMode,has,omitempty"` State int `json:"state,omitempty"` ActivedAt int64 `json:"activedAt,omitempty"` CreatedAt int64 `json:"createdAt,omitempty"` UpdatedAt int64 `json:"updatedAt,omitempty"` // 1 免费使用 // 0 正常收费 LicenseMode int `json:"licenseMode,omitempty"` // meta data Meta []byte `json:"meta,omitempty"` // device type 0:normal type, 1:gateway Type int `json:"type"` // max channel of gateway [1,64] MaxChannel int `json:"maxChannel,omitempty"` Channels []Channel `json:"channels,omitempty"` }
type DeviceAccessToken ¶
type DeviceAccessToken struct { Appid string `json:"appid"` // appId Device string `json:"device"` // device name DeadLine int64 `json:"deadline"` // 该token的有效期截止时间 Random int64 `json:"random"` // 随机数,保证DEVICE ACCESS TOKEN全局唯一 Statement []Statement `json:"statement"` // 针对那种功能进行授权 }
设备访问凭证
type DeviceHistoryItem ¶
type DeviceHistoryItem struct { LoginAt int64 `json:"loginAt"` LogoutAt int64 `json:"logoutAt"` RemoteIp string `json:"remoteIp,omitempty"` LogoutReason string `json:"logoutReason,omitempty"` }
----------------------------------------------------------------------------- 历史记录
type DeviceKey ¶
type DeviceKey struct { AccessKey string `json:"accessKey"` // 设备的 accessKey SecretKey string `json:"secretKey"` // 设备的 secretkey State int `json:"state"` // 密钥对状态,1表示被禁用,0表示已启用 CreatedAt int64 `json:"createdAt"` // 创建时间 }
设备密钥管理
type LiveRequest ¶
type LiveResponse ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager 代表一个 linking 用户的客户端
func NewManager ¶
func NewManager(mac *auth.Credentials, tr http.RoundTripper) *Manager
New 初始化 Client.
func (*Manager) AddDeviceKey ¶
新增设备的密钥,每个设备最多有两对密钥
func (*Manager) CloneDeviceKey ¶
func (manager *Manager) CloneDeviceKey(appid, fromdevice, todevice string, cleanSelfKeys, deleteDevice bool, deviceAccessKey string) ([]DeviceKey, error)
某个设备的密钥克隆给新的设备,不用重新对设备进行烧录新的密钥
func (*Manager) DeleteDevice ¶
删除指定的设备,删除后将不可恢复
func (*Manager) DeleteDeviceKey ¶
删除设备的密钥
func (*Manager) ListDevice ¶
func (manager *Manager) ListDevice(appid, prefix, marker string, limit int, online, status bool, deviceType int, batch string) ([]Device, string, error)
查询指定应用下所有设备的列表
func (*Manager) ListDeviceHistoryactivity ¶
func (manager *Manager) ListDeviceHistoryactivity(appid, dev string, start, end int, marker string, limit int) ([]DeviceHistoryItem, string, error)
查询指定时间段内设备的在线记录
func (*Manager) QueryAppidDeviceNameByAccessKey ¶
func (*Manager) QueryDevice ¶
查询指定设备的详细信息
func (*Manager) QueryDeviceKey ¶
查询指定设备的密钥
func (*Manager) RPC ¶
func (manager *Manager) RPC(appid, device string, req *RpcRequest) (*RpcResponse, error)
func (*Manager) Saveas ¶
func (manager *Manager) Saveas(appid, device string, start, end int, fname, format string) (*SaveasReply, error)
指定的视频片段进行收藏,保存在云存储上
func (*Manager) Segments ¶
func (manager *Manager) Segments(appid, device string, start, end int, marker string, limit int) ([]Segment, string, error)
视频片段查询
func (*Manager) StartLive ¶
func (manager *Manager) StartLive(req *LiveRequest) (*LiveResponse, error)
指定的视频片段进行收藏,保存在云存储上
func (*Manager) StatusToken ¶
在线记录查询/设备查询 Token
func (*Manager) UpdateDevice ¶
func (manager *Manager) UpdateDevice(appid, device string, ops []PatchOperation) (*Device, error)
更新设备配置信息的操作
func (*Manager) UpdateDeviceKeyState ¶
禁用、启用设备的密钥
type PatchOperation ¶
type RpcRequest ¶
type RpcRequest struct { Action int `json:"action"` Params json.RawMessage `json:"params,omitempty"` Timeout int `json:"timeout,omitempty"` Response bool `json:"response,omitempty"` }
----------------------------------------------------------------------------- mqtt rpc
type RpcResponse ¶
type RpcResponse struct { Id string `json:"id"` Resp DevResponse `json:"response"` }
type SaveasReply ¶
Click to show internal directories.
Click to hide internal directories.