Documentation ¶
Index ¶
- Constants
- func Do[T any](req *http.Request) (result T, code int, err error)
- func PermissionSearch(token string, searchUrl string, query QueryMessage, result interface{}) (err error, code int)
- type Auth
- type ConditionConfig
- type DeviceRepo
- func (this *DeviceRepo) CreateDeviceTypeWithDistinctAttributes(key string, dt models.DeviceType, attributeKeys []string) (result models.DeviceType, code int, err error)
- func (this *DeviceRepo) FindDeviceTypeId(device model.DeviceInfo) (dtId string, usedFallback bool, err error)
- func (this *DeviceRepo) ListZwaveDeviceTypes() (list []models.DeviceType, err error)
- type Permissions
- type QueryCheckIds
- type QueryFind
- type QueryListCommons
- type QueryListIds
- type QueryMessage
- type QueryOperationType
- type Selection
Constants ¶
View Source
const AttributeUsedForZwave = "senergy/zwave-dc"
View Source
const AttributeZwaveTypeMappingKey = "senergy/zwave-type-mapping-key"
View Source
const DtFallbackKey = "device-types"
Variables ¶
This section is empty.
Functions ¶
func PermissionSearch ¶
func PermissionSearch(token string, searchUrl string, query QueryMessage, result interface{}) (err error, code int)
Types ¶
type Auth ¶
type Auth interface {
EnsureAccess(config configuration.Config) (token string, err error)
}
type ConditionConfig ¶
type ConditionConfig struct { Feature string `json:"feature,omitempty"` Operation QueryOperationType `json:"operation,omitempty"` Value interface{} `json:"value,omitempty"` Ref string `json:"ref,omitempty"` }
type DeviceRepo ¶
type DeviceRepo struct {
// contains filtered or unexported fields
}
func New ¶
func New(config configuration.Config, auth Auth) (*DeviceRepo, error)
func (*DeviceRepo) CreateDeviceTypeWithDistinctAttributes ¶
func (this *DeviceRepo) CreateDeviceTypeWithDistinctAttributes(key string, dt models.DeviceType, attributeKeys []string) (result models.DeviceType, code int, err error)
func (*DeviceRepo) FindDeviceTypeId ¶
func (this *DeviceRepo) FindDeviceTypeId(device model.DeviceInfo) (dtId string, usedFallback bool, err error)
func (*DeviceRepo) ListZwaveDeviceTypes ¶
func (this *DeviceRepo) ListZwaveDeviceTypes() (list []models.DeviceType, err error)
type QueryCheckIds ¶
type QueryFind ¶
type QueryFind struct { QueryListCommons Search string `json:"search,omitempty"` Filter *Selection `json:"filter,omitempty"` }
type QueryListCommons ¶
type QueryListIds ¶
type QueryListIds struct { QueryListCommons Ids []string `json:"ids,omitempty"` }
type QueryMessage ¶
type QueryMessage struct { Resource string `json:"resource"` Find *QueryFind `json:"find,omitempty"` ListIds *QueryListIds `json:"list_ids,omitempty"` CheckIds *QueryCheckIds `json:"check_ids,omitempty"` TermAggregate *string `json:"term_aggregate,omitempty"` }
type QueryOperationType ¶
type QueryOperationType string
const ( QueryEqualOperation QueryOperationType = "==" QueryUnequalOperation QueryOperationType = "!=" QueryAnyValueInFeatureOperation QueryOperationType = "any_value_in_feature" )
Source Files ¶
Click to show internal directories.
Click to hide internal directories.