added method to check if the ID belongs to a group or container

This commit is contained in:
2021-08-22 18:49:49 +04:00
parent 8a278239ba
commit 4ed2e10ac3
2 changed files with 27 additions and 0 deletions

View File

@@ -162,4 +162,15 @@ func GetContainerInformation(ID string) (*TrackContainer, error) {
}
}
return nil, errors.New("Container not found. ")
}
// CheckID Checks if the ID belongs to a group or a single container
func CheckID(ID string) (string,error) {
// For group checks if the 1st characters is "grp"
if ID[0:3] == "grp" {
return "group", nil
} else {
return "container", nil
}
return "",nil
}