Documentation ¶
Overview ¶
Licensed under the Apache License, Version 2.0 (the "License"); you may not use p file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use p file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use p file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use p file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use p file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use p file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use p file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use p file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use p file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use p file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use p file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- Constants
- Variables
- type AddProjectNotify
- type AddTrackpointNotify
- type Bundle
- type BundleContentType
- type BundleKind
- type DataModel
- type DataModelField
- type DeleteProjectNotify
- type DeviceModel
- func (m *DeviceModel) AddDataModel(dataModel *DataModel)
- func (m *DeviceModel) AddEndpoint(ep *Endpoint)
- func (m *DeviceModel) WithChildModels(models []string) *DeviceModel
- func (m *DeviceModel) WithCompound(compound bool) *DeviceModel
- func (m *DeviceModel) WithDescription(description string) *DeviceModel
- func (m *DeviceModel) WithDomain(domain string) *DeviceModel
- func (m *DeviceModel) WithIcon(icon string) *DeviceModel
- func (m *DeviceModel) WithLogical(logical bool) *DeviceModel
- func (m *DeviceModel) WithName(name string) *DeviceModel
- func (m *DeviceModel) WithVersion(version string) *DeviceModel
- type Endpoint
- type ModelError
- type Project
- type Reader
- type ReaderObserver
- type UpdateProjectNotify
- type Widget
- type WidgetList
- func (wl *WidgetList) Add(widgets ...*Widget)
- func (wl *WidgetList) AddUserWidget(widgets ...*Widget)
- func (wl *WidgetList) Count() int
- func (wl *WidgetList) CountOfDomain(domain string) int
- func (wl *WidgetList) Remove(domain string, widgetName string)
- func (wl *WidgetList) RemoveUserWidget(widgetName string)
Constants ¶
const ( JsonType = "json" YamlType = "yaml" )
const ( ProjectStatus_Active = "active" ProjectStatus_Inactive = "inactive" )
Variables ¶
var ( InvalidModelError = newModelError("invalid model '%s'") InvalidBundleKindError = newModelError("invalid model bundle '%s'") InvalidBundleError = newModelError("invalid bundle '%s'") InvalidParameterError = newModelError("invalid parameter '%s'") )
Functions ¶
This section is empty.
Types ¶
type AddProjectNotify ¶
type AddProjectNotify struct {
ProjectId string
}
type AddTrackpointNotify ¶
type AddTrackpointNotify struct { Trackpoint lbs.TrackPoint ProjectId string DeviceId string DeviceName string }
type Bundle ¶
type Bundle interface { ContentType() BundleContentType Content() []byte Kind() BundleKind Name() string }
func NewBundle ¶
func NewBundle(name string, kind BundleKind, data []byte, contentType BundleContentType) Bundle
type BundleContentType ¶
type BundleContentType string
const ( ContentTypeYaml BundleContentType = "yaml" ContentTypeJson BundleContentType = "json" ContentTypeInvalid BundleContentType = "invalid" )
func ContentTypeWithNameSuffix ¶
func ContentTypeWithNameSuffix(name string) BundleContentType
type BundleKind ¶
type BundleKind string
const ( BundleKindPresentation BundleKind = "ModelPresentation" BundleKindDefinition BundleKind = "ModelDefinition" )
type DataModel ¶
type DataModel struct { Name string `json:"name"` Id string `json:"id"` Domain string `json:"domain"` Fields []*DataModelField `json:"fields"` }
func NewDataModel ¶
func NewDataModel() *DataModel
func (*DataModel) AddField ¶
func (m *DataModel) AddField(field *DataModelField)
func (*DataModel) WithDomain ¶
type DataModelField ¶
type DataModelField struct { Key string `json:"key"` Value string `json:"value"` Type string `json:"type"` DefaultValue string `json:"defaultValue"` }
func NewDataModelField ¶
func NewDataModelField(key string, tp string, defaultValue string) *DataModelField
type DeleteProjectNotify ¶
type DeleteProjectNotify struct {
ProjectId string
}
type DeviceModel ¶
type DeviceModel struct { Name string `json:"name" bson:"name"` Id string `json:"id" bson:"id"` Description string `json:"description" bson:"description"` Domain string `json:"domain" bson:"domain"` Version string `json:"version" bson:"version"` Endpoints []*Endpoint `json:"endpoints" bson:"endpoints"` DataModels []*DataModel `json:"dataModel" bson:"dataModels"` IsLogical bool `json:"isLogical" bson:"isLogical"` IsCompound bool `json:"isCompound" bson:"isCompound"` ChildModels []string `json:"childModels" bson:"childModels"` IsPreset bool `json:"isPreset" bson:"isPreset"` UserId string `json:"userId" bson:"userId"` CreatedAt time.Time `json"createdAt" bson:"createdAt"` UpdatedAt time.Time `json:"updatedAt" bson:"updatedAt"` Icon string `json:"icon" bson:"icon"` }
func NewDeviceModel ¶
func NewDeviceModel() *DeviceModel
func (*DeviceModel) AddDataModel ¶
func (m *DeviceModel) AddDataModel(dataModel *DataModel)
func (*DeviceModel) AddEndpoint ¶
func (m *DeviceModel) AddEndpoint(ep *Endpoint)
func (*DeviceModel) WithChildModels ¶
func (m *DeviceModel) WithChildModels(models []string) *DeviceModel
func (*DeviceModel) WithCompound ¶
func (m *DeviceModel) WithCompound(compound bool) *DeviceModel
func (*DeviceModel) WithDescription ¶
func (m *DeviceModel) WithDescription(description string) *DeviceModel
func (*DeviceModel) WithDomain ¶
func (m *DeviceModel) WithDomain(domain string) *DeviceModel
func (*DeviceModel) WithIcon ¶
func (m *DeviceModel) WithIcon(icon string) *DeviceModel
func (*DeviceModel) WithLogical ¶
func (m *DeviceModel) WithLogical(logical bool) *DeviceModel
func (*DeviceModel) WithName ¶
func (m *DeviceModel) WithName(name string) *DeviceModel
func (*DeviceModel) WithVersion ¶
func (m *DeviceModel) WithVersion(version string) *DeviceModel
type Endpoint ¶
type Endpoint struct { Path string `json:"path"` Format string `json:"format"` Models map[string]string `json:"models"` }
func NewEndpoint ¶
func NewEndpoint() *Endpoint
func (*Endpoint) WithDataModel ¶
func (*Endpoint) WithFormat ¶
type ModelError ¶
type ModelError struct {
// contains filtered or unexported fields
}
func (ModelError) Error ¶
func (m ModelError) Error() string
func (*ModelError) With ¶
func (m *ModelError) With(v ...interface{}) error
type Project ¶
type Project struct { Id string `json:"id"` Name string `json:"name"` UserId string `json:"user_id"` Description string `json:"description"` CreatedAt string `json:"created_at"` LastUpdatedAt string `json:"last_updated_at"` Status string `json:"status"` }
func (Project) MarshalJSON ¶
Custom JSON marshaling to trun empty strings into null pointers
type Reader ¶
type Reader interface { Name() string Config() map[string]interface{} Start() error RegisterObserver(ReaderObserver) GracefulShutdown() error }
type ReaderObserver ¶
type UpdateProjectNotify ¶
type UpdateProjectNotify struct {
ProjectId string
}
type Widget ¶
type Widget struct { Name string `json:"name" bson:"name"` Id string `json:"id" bson:"id"` Domain string `json:"domain" bson:"domain"` Version string `json:"version" bson:"version"` Endpoints []*Endpoint `json:"endpoints" bson:"endpoints"` DataModels []*DataModel `json:"dataModel" bson:"dataModels"` IsLogical bool `json:"isLogical" bson:"isLogical"` IsCompound bool `json:"isCompound" bson:"isCompound"` IsPreset bool `json:"isPreset" bson:"isPreset"` Icon string `json:"icon" bson:"icon"` }
func NewWidgetWithDeviceModel ¶
func NewWidgetWithDeviceModel(m *DeviceModel) *Widget
type WidgetList ¶
func NewWidgetList ¶
func NewWidgetList() *WidgetList
func (*WidgetList) Add ¶
func (wl *WidgetList) Add(widgets ...*Widget)
func (*WidgetList) AddUserWidget ¶
func (wl *WidgetList) AddUserWidget(widgets ...*Widget)
func (*WidgetList) Count ¶
func (wl *WidgetList) Count() int
func (*WidgetList) CountOfDomain ¶
func (wl *WidgetList) CountOfDomain(domain string) int
func (*WidgetList) Remove ¶
func (wl *WidgetList) Remove(domain string, widgetName string)
func (*WidgetList) RemoveUserWidget ¶
func (wl *WidgetList) RemoveUserWidget(widgetName string)