relation

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2020 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Relation

type Relation struct {
	device.DeviceBase
	PageId int64 `json:"page_id"`
}

type RelationIterator

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

RelationIterator

iter, err := NewRelationIterator(*core.Client, *SearchQuery)
if err != nil {
    // TODO: 增加你的代码
}

for iter.HasNext() {
    items, err := iter.NextPage()
    if err != nil {
        // TODO: 增加你的代码
    }
    // TODO: 增加你的代码
}

func NewRelationIterator

func NewRelationIterator(clt *core.Client, query *SearchQuery) (iter *RelationIterator, err error)

func (*RelationIterator) HasNext

func (iter *RelationIterator) HasNext() bool

func (*RelationIterator) NextPage

func (iter *RelationIterator) NextPage() (relations []Relation, err error)

func (*RelationIterator) TotalCount

func (iter *RelationIterator) TotalCount() int

type SearchQuery

type SearchQuery struct {
	Type             int                      `json:"type"`                        // 查询方式。1: 查询设备的关联关系;2:查询页面的关联关系
	DeviceIdentifier *device.DeviceIdentifier `json:"device_identifier,omitempty"` // 指定的设备;当type为1时,此项为必填
	PageId           *int64                   `json:"page_id,omitempty"`           // 指定的页面id;当type为2时,此项为必填
	Begin            *int                     `json:"begin,omitempty"`             // 关联关系列表的起始索引值;当type为2时,此项为必填
	Count            *int                     `json:"count,omitempty"`             // 待查询的关联关系数量,不能超过50个;当type为2时,此项为必填
}

func NewSearchQuery1

func NewSearchQuery1(deviceIdentifier *device.DeviceIdentifier) *SearchQuery

func NewSearchQuery1X

func NewSearchQuery1X(deviceIdentifier *device.DeviceIdentifier, begin, count int) *SearchQuery

func NewSearchQuery2

func NewSearchQuery2(pageId int64, begin, count int) *SearchQuery

type SearchResult

type SearchResult struct {
	TotalCount int        `json:"total_count"` // 设备或页面的关联关系总数
	ItemCount  int        `json:"item_count"`  // 查询的关联关系数量
	Relations  []Relation `json:"relations"`   // 查询的关联关系列表
}
func Search(clt *core.Client, query *SearchQuery) (rslt *SearchResult, err error)

查询设备与页面的关联关系.

Jump to

Keyboard shortcuts

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