Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type JsonCameraInput ¶
type JsonCameraInput struct {
Name *string `json:"Name"`
Ipaddr *string `json:"Ipaddr"`
Port *string `json:"Port"`
Desc *string `json:"Desc"`
//Integer status value and '0'(default value) is not a vaid input. so no
// need to use it as pointer.
Status dataSet.CameraStatus `json:"Status"`
UserId *string `json:"UserId"`
Pwd *string `json:"Pwd"`
VideoLenSec uint64 `json:"VideoLenSec"`
SnapInterval uint64 `json:"VideoSnapInterval"`
}
Must be updated when original camera structure is modified. This structure has one to one mapping to original camera structure. The camera parameters that are exposed to outside world for input are only included in this Json. When deseralizing the data from json, application must know if the field is being notprovided or empty value. Json unmarshalling set all the unprovided values to its default. i.e for string it is "", for integer its 0 and so on. So to distinguish default from unprovided values, a model struct is being used instead of using original structure for unmarshalling. The new model keep 1:1 mapping to all the fields in original structure except their datatypes. The datatypes are set to pointer for every field which need to accept default values as valid input.
func (*JsonCameraInput) AllocateFields ¶
func (jsonCam *JsonCameraInput) AllocateFields()
Allocate memory to all the string fields that needed for the json structure.
func (*JsonCameraInput) ReadJsonData ¶
func (jsonCam *JsonCameraInput) ReadJsonData(camRowOut *dataSet.Camera)
Read the data from Json structure 'jsonCam' and populate the 'camRowOut'. This function leave the'camRowOut' fields untouched when its not set in input 'jsonCam'
type RestAPI ¶
type RestAPI struct {
// contains filtered or unexported fields
}
func (*RestAPI) RestAPIMainHandler ¶
The main handler function for handling http rest request. Normally they are running in seperate goroutine.