diff options
author | Pawel Wieczorek <p.wieczorek2@samsung.com> | 2018-07-30 18:09:57 +0200 |
---|---|---|
committer | Pawel Wieczorek <p.wieczorek2@samsung.com> | 2018-07-30 18:09:57 +0200 |
commit | 6a626ad5e43e0a972c25ec76d92339f22acb838b (patch) | |
tree | b46a4a9a24ceb9e3485cdb67d940cc4c47eaa33d /job_status_extra.go | |
parent | 8032cffb294d3f9713f54e2ce9e761abef016d2d (diff) | |
parent | 86fc35346a6850dadbe2290369164c9dd5600f85 (diff) | |
download | weles-6a626ad5e43e0a972c25ec76d92339f22acb838b.tar.gz weles-6a626ad5e43e0a972c25ec76d92339f22acb838b.tar.bz2 weles-6a626ad5e43e0a972c25ec76d92339f22acb838b.zip |
Merge branch 'api'cors
Change-Id: I73745abe146f5e9d6e3a9ba886f727da53a2b32e
Diffstat (limited to 'job_status_extra.go')
-rw-r--r-- | job_status_extra.go | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/job_status_extra.go b/job_status_extra.go new file mode 100644 index 0000000..ed9968f --- /dev/null +++ b/job_status_extra.go @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2018 Samsung Electronics Co., Ltd All Rights Reserved + * + * 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 + */ + +// File job_status_extra.go enhances generated JobStatus type. + +package weles + +// ToInt converts JobStatus to int. +func (status JobStatus) ToInt() int { + switch status { + case JobStatusNEW: + return 1 + case JobStatusPARSING: + return 2 + case JobStatusDOWNLOADING: + return 3 + case JobStatusWAITING: + return 4 + case JobStatusRUNNING: + return 5 + case JobStatusCOMPLETED: + return 6 + case JobStatusFAILED: + return 7 + case JobStatusCANCELED: + return 8 + default: + return -1 + } +} |