Documentation ¶
Overview ¶
Copyright 2017 Northern.tech AS
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this 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 ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Device ¶
type Device struct { //system-generated device ID ID DeviceID `json:"id" bson:"_id,omitempty" valid:"length(1|1024),required"` //a map of attributes names and their values. Attributes DeviceAttributes `json:"attributes,omitempty" bson:",omitempty" valid:"optional"` //device's group name Group GroupName `json:"-" bson:"group,omitempty" valid:"optional"` CreatedTs time.Time `json:"-" bson:"created_ts,omitempty"` //Timestamp of the last attribute update. UpdatedTs time.Time `json:"updated_ts" bson:"updated_ts,omitempty"` }
Device wrapper
type DeviceAttribute ¶
type DeviceAttribute struct { Name string `json:"name" bson:",omitempty" valid:"length(1|4096),required"` Description *string `json:"description,omitempty" bson:",omitempty" valid:"optional"` Value interface{} `json:"value" bson:",omitempty" valid:"length(1|4096),required,deviceAttributeValueValidator"` }
type DeviceAttributes ¶
type DeviceAttributes map[string]DeviceAttribute
wrapper for device attributes names and values
func (DeviceAttributes) MarshalJSON ¶
func (d DeviceAttributes) MarshalJSON() ([]byte, error)
func (*DeviceAttributes) UnmarshalJSON ¶
func (d *DeviceAttributes) UnmarshalJSON(b []byte) error
Click to show internal directories.
Click to hide internal directories.