core

package
v0.4.6 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const AppID = "core"
View Source
const MimeJson = "application/json"

Variables

This section is empty.

Functions

func CreateEntityURL added in v0.4.4

func CreateEntityURL(entityID, userID, source string) string

func CreateSubscriptionURL added in v0.4.5

func CreateSubscriptionURL(subID, userID, source, typeOf string) string

func IntoFilterQuery added in v0.4.5

func IntoFilterQuery(to string, from string) string

func PatchEntityURL

func PatchEntityURL(entityID string) string

func QueryDeviceEntityURL

func QueryDeviceEntityURL(entityID string) string

Types

type BasicInfo

type BasicInfo struct {
	Description  string
	Name         string
	TemplateID   string `json:"templateId"`
	TemplateName string `json:"templateName"`
	ParentID     string `json:"parentId"`
	ParentName   string `json:"parentName"`
}

type Client

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

func NewCoreClient

func NewCoreClient() (*Client, error)

func (Client) CreateEntity added in v0.4.4

func (c Client) CreateEntity(id, userID, source string) (*Entity, error)

func (Client) GetDeviceEntity

func (c Client) GetDeviceEntity(entityID string) (*Entity, error)

func (Client) PatchEntity

func (c Client) PatchEntity(entityID string, data []map[string]interface{}) error

func (*Client) Subscribe

func (c *Client) Subscribe(subscriptionID, entityID, topic string) error

func (*Client) Unsubscribe

func (c *Client) Unsubscribe(subscriptionID string) error

type Entity

type Entity struct {
	Config     interface{}
	Id         string
	Mappers    []interface{}
	Owner      string
	Properties Property
	Source     string
	Type       string
}

type GetEntityResponse

type GetEntityResponse struct {
	Code string
	Data Entity
	Msg  string
}

type Group

type Group struct {
	Description string                 `json:"description"`
	Ext         map[string]interface{} `json:"ext"`
	Name        string                 `json:"name"`
}

type ListEntity

type ListEntity struct {
	Items    []Entity
	PageSize int32
	PageNum  int32
	Total    string
}

type Property

type Property struct {
	Group     Group     `json:"group,omitempty"`
	BasicInfo BasicInfo `json:"basicInfo"`
	SysField  SysField  `json:"sysField"`
}

type SubscriptionData

type SubscriptionData struct {
	Mode       string `json:"mode,omitempty"`
	Source     string `json:"source,omitempty"`
	Filter     string `json:"filter,omitempty"`
	Topic      string `json:"topic,omitempty"`
	PubsubName string `json:"pubsub_name,omitempty"`
}

type SysField

type SysField struct {
	ID            string `json:"_id"`
	Owner         string `json:"_owner"`
	Source        string `json:"_source"`
	Status        string `json:"_status"`
	SubscribeAddr string `json:"_subscribeAddr"`
	RuleInfo      string `json:"_ruleInfo"`
	CreatedAt     int64  `json:"_createdAt"`
	UpdatedAt     int64  `json:"_updatedAt"`
}

Jump to

Keyboard shortcuts

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