Documentation ¶
Overview ¶
Copyright 2018 Pantacor Ltd.
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.
Copyright 2018 Pantacor Ltd.
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.
Copyright 2018 Pantacor Ltd.
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.
Copyright 2019 Pantacor Ltd.
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.
Copyright 2018 Pantacor Ltd.
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.
Copyright 2018 Pantacor Ltd.
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.
Copyright 2018 Pantacor Ltd.
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 ¶
- Variables
- func AssignUserToDevice(t *testing.T, deviceID string, Challenge string) (map[string]interface{}, *resty.Response)
- func ChangeDeviceSecret(t *testing.T, deviceID string, newSecret string) (map[string]interface{}, *resty.Response)
- func CheckResult(result map[string]interface{}, expectedResult map[string]interface{}) bool
- func ClearOldData(t *testing.T, mongoDb *mongo.Database) bool
- func CreateDevice(t *testing.T, claim bool, secret string) (models.Device, *resty.Response)
- func CreateLog(t *testing.T, dToken string, logData map[string]interface{}) ([]interface{}, *resty.Response)
- func CreateObject(t *testing.T, sha string) (objectSha string, object models.Object, res *resty.Response)
- func CreateStep(t *testing.T, device models.Device, revision int, includeState bool, ...) (models.Step, *resty.Response)
- func CreateTrail(t *testing.T, device models.Device, includeState bool, objectSha string) (models.Trail, *resty.Response)
- func DeleteAllDevices(t *testing.T, mongoDb *mongo.Database) bool
- func DeleteAllObjects(t *testing.T, mongoDb *mongo.Database) bool
- func DeleteAllPersonalLogs(t *testing.T, mongoDb *mongo.Database) bool
- func DeleteAllSteps(t *testing.T, mongoDb *mongo.Database) bool
- func DeleteAllTrails(t *testing.T, mongoDb *mongo.Database) bool
- func DeleteAllUserAccounts(t *testing.T, mongoDb *mongo.Database) bool
- func DeleteDevice(t *testing.T, deviceID string, mongoDb *mongo.Database) bool
- func DeleteDeviceGarbages(t *testing.T) (map[string]interface{}, *resty.Response)
- func DeleteTrail(t *testing.T, trailID string, mongoDb *mongo.Database) bool
- func DisplayCounters()
- func GenerateObjectSha() string
- func GetDevice(t *testing.T, deviceID string) (map[string]interface{}, *resty.Response)
- func GetStep(t *testing.T, trailID string, step string) (map[string]interface{}, *resty.Response)
- func GetUser(t *testing.T, email string, mongoDb *mongo.Database) accounts.Account
- func ListLogs(t *testing.T) (map[string]interface{}, *resty.Response)
- func ListObjects(t *testing.T) (response []interface{}, res *resty.Response)
- func ListSteps(t *testing.T, trailID string) ([]interface{}, *resty.Response)
- func ListTrails(t *testing.T, deviceID string, dToken string) ([]interface{}, *resty.Response)
- func ListUserDevices(t *testing.T) ([]interface{}, *resty.Response)
- func Login(t *testing.T, username string, password string) (map[string]interface{}, *resty.Response)
- func LoginDevice(t *testing.T, username string, password string) (map[string]interface{}, *resty.Response)
- func MakeDeviceNonPublic(t *testing.T, deviceID string) (map[string]interface{}, *resty.Response)
- func MakeDevicePublic(t *testing.T, deviceID string) (map[string]interface{}, *resty.Response)
- func MarkAllUnClaimedDevicesAsGrabage(t *testing.T) (map[string]interface{}, *resty.Response)
- func MarkDeviceAsGarbage(t *testing.T, deviceID string) (map[string]interface{}, *resty.Response)
- func MarkTrailsAsGarbage(t *testing.T) (map[string]interface{}, *resty.Response)
- func ParseDuration(str string) time.Duration
- func ParseInt64(value string) int64
- func PopulateStepUsedObjects(t *testing.T, stepID string) (map[string]interface{}, *resty.Response)
- func PopulateStepsUsedObjects(t *testing.T) (map[string]interface{}, *resty.Response)
- func PopulateTrailUsedObjects(t *testing.T, trailID string) (map[string]interface{}, *resty.Response)
- func PopulateTrailsUsedObjects(t *testing.T) (map[string]interface{}, *resty.Response)
- func ProcessDeviceGarbages(t *testing.T) (map[string]interface{}, *resty.Response)
- func ProcessStepGarbages(t *testing.T) (map[string]interface{}, *resty.Response)
- func ProcessTrailGarbages(t *testing.T) (map[string]interface{}, *resty.Response)
- func RandStringRunes(n int) string
- func RefreshToken(t *testing.T, token string) (map[string]interface{}, *resty.Response)
- func Register(t *testing.T, email string, password string, nick string) (map[string]interface{}, *resty.Response)
- func RemoveDevice(t *testing.T, deviceID string) (map[string]interface{}, *resty.Response)
- func ResetCounters()
- func UpdateDeviceMetaDetails(t *testing.T, dToken string, deviceID string, details map[string]interface{}) (map[string]interface{}, *resty.Response)
- func UpdateDeviceNick(t *testing.T, deviceID string, newNick string) (map[string]interface{}, *resty.Response)
- func UpdateDeviceTimeCreated(t *testing.T, deviceID string, mongoDb *mongo.Database) bool
- func UpdateObjectGarbageRemovalDate(t *testing.T, objectID string, mongoDb *mongo.Database) bool
- func UpdateStepGarbageRemovalDate(t *testing.T, stepID string, mongoDb *mongo.Database) bool
- func UpdateStepProgress(t *testing.T, trailID string, step string, dtoken string, ...) (map[string]interface{}, *resty.Response)
- func UpdateTrailGarbageRemovalDate(t *testing.T, trailID string, mongoDb *mongo.Database) bool
- func UpdateUserMetaDetails(t *testing.T, deviceID string, details map[string]interface{}) (map[string]interface{}, *resty.Response)
- func VerifyUserAccount(t *testing.T, id string, challenge string) (map[string]interface{}, *resty.Response)
Constants ¶
This section is empty.
Variables ¶
var BaseAPIUrl = "http://" + utils.GetEnv("PANTAHUB_HOST") + ":" + utils.GetEnv("PANTAHUB_PORT")
BaseAPIUrl : Pantahub Base API END POINT
var Devices []models.Device
Devices : to keep the generated devices documents
var DevicesCount = 0
DevicesCount : to keep the generated DeviceCount
var GCAPIUrl = utils.GetEnv("PANTAHUB_GC_API")
GCAPIUrl : Garbage collector API END POINT
var InvalidObjectsCount = 0
InvalidObjectsCount : Invalid Objects Count
var InvalidStepsCount = 0
InvalidStepsCount : Invalid Steps Count
var InvalidTrailsCount = 0
InvalidTrailsCount : Invalid Trails Count
var Objects []models.Object
Objects : to keep the generated object documents
var ObjectsCount = 0
ObjectsCount : Objects Count
var ReUsedObjectsCount = 0
ReUsedObjectsCount : ReUsed Objects Count
var Steps []models.Step
Steps : to keep the generated steps documents
var StepsCount = 0
StepsCount : Steps Count
var Trails []models.Trail
Trails : to keep the generated trails documents
var TrailsCount = 0
TrailsCount : TrailsCount
var UTOKEN = ""
UTOKEN : to keep User access token
Functions ¶
func AssignUserToDevice ¶
func AssignUserToDevice( t *testing.T, deviceID string, Challenge string, ) ( map[string]interface{}, *resty.Response, )
AssignUserToDevice : Assign User To Device
func ChangeDeviceSecret ¶
func ChangeDeviceSecret( t *testing.T, deviceID string, newSecret string, ) ( map[string]interface{}, *resty.Response, )
ChangeDeviceSecret : Change Device Secret
func CheckResult ¶
CheckResult : Used to compare expected result vs obtained result
func ClearOldData ¶
ClearOldData : Clear all old data and reset counters
func CreateDevice ¶
CreateDevice : Register a Device (As User)
func CreateLog ¶
func CreateLog( t *testing.T, dToken string, logData map[string]interface{}, ) ( []interface{}, *resty.Response, )
CreateLog : Create A Log
func CreateObject ¶
func CreateObject( t *testing.T, sha string, ) ( objectSha string, object models.Object, res *resty.Response, )
CreateObject : Create new Object
func CreateStep ¶
func CreateStep( t *testing.T, device models.Device, revision int, includeState bool, objectSha string, ) ( models.Step, *resty.Response, )
CreateStep : Create new Step under a trail
func CreateTrail ¶
func CreateTrail( t *testing.T, device models.Device, includeState bool, objectSha string, ) ( models.Trail, *resty.Response, )
CreateTrail : Create a trail
func DeleteAllDevices ¶
DeleteAllDevices : Delete All Devices
func DeleteAllObjects ¶
DeleteAllObjects : Delete All Objects
func DeleteAllPersonalLogs ¶
DeleteAllPersonalLogs : Delete All Personal Logs
func DeleteAllSteps ¶
DeleteAllSteps : Delete All Steps from the database
func DeleteAllTrails ¶
DeleteAllTrails : Delete All Trails
func DeleteAllUserAccounts ¶
DeleteAllUserAccounts : Delete All User Accounts
func DeleteDevice ¶
DeleteDevice : Delete a Device from database
func DeleteDeviceGarbages ¶
DeleteDeviceGarbages : Delete Device Garbages
func DeleteTrail ¶
DeleteTrail : Delete a Trail
func GenerateObjectSha ¶
func GenerateObjectSha() string
GenerateObjectSha : Generate ObjectSha string
func GetStep ¶
func GetStep( t *testing.T, trailID string, step string, ) ( map[string]interface{}, *resty.Response, )
GetStep : Get Step Details
func ListObjects ¶
ListObjects : List Objects
func ListTrails ¶
func ListTrails( t *testing.T, deviceID string, dToken string, ) ( []interface{}, *resty.Response, )
ListTrails : List Trails Of A Device
func ListUserDevices ¶
ListUserDevices : List User Devices
func Login ¶
func Login( t *testing.T, username string, password string, ) ( map[string]interface{}, *resty.Response, )
Login : Login user
func LoginDevice ¶
func LoginDevice( t *testing.T, username string, password string, ) ( map[string]interface{}, *resty.Response, )
LoginDevice : Login Device
func MakeDeviceNonPublic ¶
func MakeDeviceNonPublic( t *testing.T, deviceID string, ) ( map[string]interface{}, *resty.Response, )
MakeDeviceNonPublic : Make Device Non Public
func MakeDevicePublic ¶
func MakeDevicePublic( t *testing.T, deviceID string, ) ( map[string]interface{}, *resty.Response, )
MakeDevicePublic : Make Device Public
func MarkAllUnClaimedDevicesAsGrabage ¶
MarkAllUnClaimedDevicesAsGrabage : Mark All UnClaimed Devices As Grabage
func MarkDeviceAsGarbage ¶
func MarkDeviceAsGarbage(t *testing.T, deviceID string) ( map[string]interface{}, *resty.Response, )
MarkDeviceAsGarbage : Mark Device as Garbage
func MarkTrailsAsGarbage ¶
MarkTrailsAsGarbage : Mark Trails as Garbages that lost their parent devices
func ParseDuration ¶
ParseDuration : Parse Duration referece : https://stackoverflow.com/questions/28125963/golang-parse-time-duration
func PopulateStepUsedObjects ¶
func PopulateStepUsedObjects(t *testing.T, stepID string) ( map[string]interface{}, *resty.Response, )
PopulateStepUsedObjects : Populate Step used_objects field
func PopulateStepsUsedObjects ¶
PopulateStepsUsedObjects : Populate Steps used_objects field
func PopulateTrailUsedObjects ¶
func PopulateTrailUsedObjects(t *testing.T, trailID string) ( map[string]interface{}, *resty.Response, )
PopulateTrailUsedObjects : Populate Trail used_objects field
func PopulateTrailsUsedObjects ¶
PopulateTrailsUsedObjects : Populate Trails used_objects field
func ProcessDeviceGarbages ¶
ProcessDeviceGarbages : Process Device Garbages
func ProcessStepGarbages ¶
ProcessStepGarbages : Process Step Garbages
func ProcessTrailGarbages ¶
ProcessTrailGarbages : Process Device Garbages
func RefreshToken ¶
RefreshToken : Refresh Token
func Register ¶
func Register( t *testing.T, email string, password string, nick string, ) ( map[string]interface{}, *resty.Response, )
Register : Register user account
func RemoveDevice ¶
RemoveDevice : Delete Device using base API
func UpdateDeviceMetaDetails ¶
func UpdateDeviceMetaDetails( t *testing.T, dToken string, deviceID string, details map[string]interface{}, ) ( map[string]interface{}, *resty.Response, )
UpdateDeviceMetaDetails : Update Device Meta Details
func UpdateDeviceNick ¶
func UpdateDeviceNick( t *testing.T, deviceID string, newNick string, ) ( map[string]interface{}, *resty.Response, )
UpdateDeviceNick : Update Device Nick Name
func UpdateDeviceTimeCreated ¶
UpdateDeviceTimeCreated : Update Device timecreated field
func UpdateObjectGarbageRemovalDate ¶
UpdateObjectGarbageRemovalDate : Update Object Garbage Removal Date
func UpdateStepGarbageRemovalDate ¶
UpdateStepGarbageRemovalDate : Update Step Garbage Removal Date
func UpdateStepProgress ¶
func UpdateStepProgress( t *testing.T, trailID string, step string, dtoken string, progressData map[string]interface{}, ) ( map[string]interface{}, *resty.Response, )
UpdateStepProgress : Update Step Progress
func UpdateTrailGarbageRemovalDate ¶
UpdateTrailGarbageRemovalDate : Update Trail Garbage Removal Date
Types ¶
This section is empty.