service

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2022 License: MIT Imports: 19 Imported by: 0

README

Service

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetTime

func GetTime() int64

get time

func GetUUID

func GetUUID() string

generate uuid

Types

type Config added in v0.3.0

type Config struct {
	ID                string                 `json:"id" mapstructure:"id"`
	Type              string                 `json:"type" mapstructure:"type"`
	Weight            int                    `json:"weight" mapstructure:"weight"`
	Enabled           bool                   `json:"enabled" mapstructure:"enabled"`
	EnabledSearch     bool                   `json:"enabled_search" mapstructure:"enabled_search"`
	EnabledTimeSeries bool                   `json:"enabled_time_series" mapstructure:"enabled_time_series"`
	Description       string                 `json:"description" mapstructure:"description"`
	Define            map[string]interface{} `json:"define" mapstructure:"define"`
	LastTime          int64                  `json:"last_time" mapstructure:"last_time"`
}

type CoreClient

type CoreClient struct {
}

func NewCoreClient

func NewCoreClient() *CoreClient

func (*CoreClient) CreatEntityToken

func (c *CoreClient) CreatEntityToken(entityType, id, owner string, token string) (string, error)

func (*CoreClient) Delete

func (c *CoreClient) Delete(url string) ([]byte, error)

func (*CoreClient) Get

func (c *CoreClient) Get(url string) ([]byte, error)

func (*CoreClient) GetCoreUrl

func (c *CoreClient) GetCoreUrl(midUrl string, mapUrl map[string]string, entityType string) string

get core url

func (*CoreClient) GetTokenMap

func (c *CoreClient) GetTokenMap(ctx context.Context) (map[string]string, error)

get token

func (*CoreClient) ParseResp

func (c *CoreClient) ParseResp(resp *http.Response, err error) ([]byte, error)

func (*CoreClient) Patch

func (c *CoreClient) Patch(url string, data []byte) ([]byte, error)

func (*CoreClient) Post

func (c *CoreClient) Post(url string, data []byte) ([]byte, error)

func (*CoreClient) Put

func (c *CoreClient) Put(url string, data []byte) ([]byte, error)

type CorePatch

type CorePatch struct {
	Path     string      `json:"path"`
	Operator string      `json:"operator"`
	Value    interface{} `json:"value"`
}

type DeviceService

type DeviceService struct {
	pb.UnimplementedDeviceServer
	// contains filtered or unexported fields
}

func NewDeviceService

func NewDeviceService() *DeviceService

func (*DeviceService) AddDeviceExt

func (s *DeviceService) AddDeviceExt(ctx context.Context, req *pb.AddDeviceExtRequest) (*emptypb.Empty, error)

func (*DeviceService) CorePatchMethod added in v0.3.0

func (s *DeviceService) CorePatchMethod(ctx context.Context, entityId string, kv map[string]interface{}, path string, operator string) (*emptypb.Empty, error)

func (*DeviceService) CreateDevice

func (*DeviceService) DeleteDevice

func (s *DeviceService) DeleteDevice(ctx context.Context, req *pb.DeleteDeviceRequest) (*emptypb.Empty, error)

func (*DeviceService) DeleteDeviceExt

func (s *DeviceService) DeleteDeviceExt(ctx context.Context, req *pb.DeleteDeviceExtRequest) (*emptypb.Empty, error)

func (*DeviceService) EnableDevice

func (s *DeviceService) EnableDevice(ctx context.Context, req *pb.EnableDeviceRequest) (*emptypb.Empty, error)

func (*DeviceService) GetDevice

func (*DeviceService) ListDevice

func (*DeviceService) UpdateDevice

func (*DeviceService) UpdateDeviceExt

func (s *DeviceService) UpdateDeviceExt(ctx context.Context, req *pb.UpdateDeviceExtRequest) (*emptypb.Empty, error)

type GroupService

type GroupService struct {
	pb.UnimplementedGroupServer
	// contains filtered or unexported fields
}

func NewGroupService

func NewGroupService() *GroupService

func (*GroupService) AddGroupExt

func (s *GroupService) AddGroupExt(ctx context.Context, req *pb.AddGroupExtRequest) (*emptypb.Empty, error)

func (*GroupService) AddGroupItems

func (s *GroupService) AddGroupItems(ctx context.Context, req *pb.AddGroupItemsRequest) (*emptypb.Empty, error)

func (*GroupService) CorePatchMethod

func (s *GroupService) CorePatchMethod(ctx context.Context, entityId string, kv map[string]interface{}, path string, operator string) (*emptypb.Empty, error)

func (*GroupService) CreateGroup

func (*GroupService) DelGroupExt

func (s *GroupService) DelGroupExt(ctx context.Context, req *pb.DelGroupExtRequest) (*emptypb.Empty, error)

func (*GroupService) DelGroupItems

func (s *GroupService) DelGroupItems(ctx context.Context, req *pb.DelGroupItemsRequest) (*emptypb.Empty, error)

func (*GroupService) DeleteGroup

func (s *GroupService) DeleteGroup(ctx context.Context, req *pb.DeleteGroupRequest) (*emptypb.Empty, error)

func (*GroupService) GetGroup

func (*GroupService) ListGroup

func (*GroupService) ListGroupItems

func (*GroupService) UpdateGroup

func (*GroupService) UpdateGroupExt

func (s *GroupService) UpdateGroupExt(ctx context.Context, req *pb.UpdateGroupExtRequest) (*emptypb.Empty, error)

type OpenapiService

type OpenapiService struct {
	v1.UnimplementedOpenapiServer
}

OpenapiService is a openapi service.

func NewOpenapiService

func NewOpenapiService() *OpenapiService

NewOpenapiService new a openapi service.

func (*OpenapiService) AddonsIdentify

AddonsIdentify implements AddonsIdentify.OpenapiServer.

func (*OpenapiService) Identify

Identify implements Identify.OpenapiServer.

func (*OpenapiService) Status

Status implements Status.OpenapiServer.

func (*OpenapiService) TenantBind

TenantBind implements TenantBind.OpenapiServer.

func (*OpenapiService) TenantUnbind

TenantUnbind implements TenantUnbind.OpenapiServer.

type TemplateService added in v0.3.0

type TemplateService struct {
	pb.UnimplementedTemplateServer
	// contains filtered or unexported fields
}

func NewTemplateService added in v0.3.0

func NewTemplateService() *TemplateService

func (*TemplateService) AddTemplateAttribute added in v0.3.0

func (s *TemplateService) AddTemplateAttribute(ctx context.Context, req *pb.AddTemplateAttributeRequest) (*emptypb.Empty, error)

func (*TemplateService) AddTemplateCommand added in v0.3.0

func (s *TemplateService) AddTemplateCommand(ctx context.Context, req *pb.AddTemplateCommandRequest) (*emptypb.Empty, error)

func (*TemplateService) AddTemplateTelemetry added in v0.3.0

func (s *TemplateService) AddTemplateTelemetry(ctx context.Context, req *pb.AddTemplateTelemetryRequest) (*emptypb.Empty, error)

func (*TemplateService) AddTemplateTelemetryExt added in v0.3.0

func (s *TemplateService) AddTemplateTelemetryExt(ctx context.Context, req *pb.AddTemplateTelemetryExtRequest) (*emptypb.Empty, error)

func (*TemplateService) CoreConfigPatchMethod added in v0.3.0

func (s *TemplateService) CoreConfigPatchMethod(ctx context.Context, entityId string, kv map[string]interface{}, path string, operator string) (*emptypb.Empty, error)

abstraction

func (*TemplateService) CreateTemplate added in v0.3.0

func (*TemplateService) DeleteTemplate added in v0.3.0

func (s *TemplateService) DeleteTemplate(ctx context.Context, req *pb.DeleteTemplateRequest) (*emptypb.Empty, error)

func (*TemplateService) DeleteTemplateAttribute added in v0.3.0

func (s *TemplateService) DeleteTemplateAttribute(ctx context.Context, req *pb.DeleteTemplateAttributeRequest) (*emptypb.Empty, error)

func (*TemplateService) DeleteTemplateCommand added in v0.3.0

func (s *TemplateService) DeleteTemplateCommand(ctx context.Context, req *pb.DeleteTemplateCommandRequest) (*emptypb.Empty, error)

func (*TemplateService) DeleteTemplateTelemetry added in v0.3.0

func (s *TemplateService) DeleteTemplateTelemetry(ctx context.Context, req *pb.DeleteTemplateTelemetryRequest) (*emptypb.Empty, error)

func (*TemplateService) DeleteTemplateTelemetryExt added in v0.3.0

func (s *TemplateService) DeleteTemplateTelemetryExt(ctx context.Context, req *pb.DeleteTemplateTelemetryExtRequest) (*emptypb.Empty, error)

func (*TemplateService) GetTemplate added in v0.3.0

func (*TemplateService) GetTemplateAttribute added in v0.3.0

func (*TemplateService) GetTemplateCommand added in v0.3.0

func (*TemplateService) GetTemplatePropConfig added in v0.3.0

func (s *TemplateService) GetTemplatePropConfig(ctx context.Context, entityId string, propId string, classify string) (*pb.EntityResponse, error)

func (*TemplateService) GetTemplateTelemetry added in v0.3.0

func (*TemplateService) GetTemplateTelemetryDefine added in v0.3.0

func (s *TemplateService) GetTemplateTelemetryDefine(ctx context.Context, entityId string, propConfigId string) (map[string]interface{}, error)

func (*TemplateService) ListTemplate added in v0.3.0

func (*TemplateService) ListTemplateAttribute added in v0.3.0

func (*TemplateService) ListTemplateCommand added in v0.3.0

func (*TemplateService) ListTemplatePropConfig added in v0.3.0

func (s *TemplateService) ListTemplatePropConfig(ctx context.Context, entityId string, classify string) (*pb.EntityResponse, error)

func (*TemplateService) ListTemplateTelemetry added in v0.3.0

func (*TemplateService) UpdateTemplate added in v0.3.0

func (*TemplateService) UpdateTemplateAttribute added in v0.3.0

func (s *TemplateService) UpdateTemplateAttribute(ctx context.Context, req *pb.UpdateTemplateAttributeRequest) (*emptypb.Empty, error)

func (*TemplateService) UpdateTemplateCommand added in v0.3.0

func (s *TemplateService) UpdateTemplateCommand(ctx context.Context, req *pb.UpdateTemplateCommandRequest) (*emptypb.Empty, error)

func (*TemplateService) UpdateTemplateTelemetry added in v0.3.0

func (s *TemplateService) UpdateTemplateTelemetry(ctx context.Context, req *pb.UpdateTemplateTelemetryRequest) (*emptypb.Empty, error)

func (*TemplateService) UpdateTemplateTelemetryExt added in v0.3.0

func (s *TemplateService) UpdateTemplateTelemetryExt(ctx context.Context, req *pb.UpdateTemplateTelemetryExtRequest) (*emptypb.Empty, error)

Jump to

Keyboard shortcuts

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