-
Notifications
You must be signed in to change notification settings - Fork 2
/
objects.go
47 lines (40 loc) · 1.16 KB
/
objects.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
package bigquery
import (
bq "cloud.google.com/go/bigquery"
)
const (
defaultAPIScope = "https://www.googleapis.com/auth/bigquery"
cloudPlatformAPIScope = "https://www.googleapis.com/auth/cloud-platform"
)
// ExtractJobState State is one of a sequence of states that a Job progresses through as it is processed.
type ExtractJobState int
const (
// StateUnspecified is the default JobIterator state.
StateUnspecified ExtractJobState = iota
// Pending is a state that describes that the job is pending.
Pending
// Running is a state that describes that the job is running.
Running
// Done is a state that describes that the job is done.
Done
// Failed is a state that describes that the job complete unsuccessfully.
Failed
// FailedQuotaExceeded for project exceeded 11 TB
FailedQuotaExceeded
)
func (s ExtractJobState) String() string {
return []string{"Unspecified", "Pending", "Running", "Done", "Failed"}[s]
}
func toJobState(status bq.State) ExtractJobState {
switch status {
case bq.StateUnspecified:
return StateUnspecified
case bq.Pending:
return Pending
case bq.Running:
return Running
case bq.Done:
return Done
}
return StateUnspecified
}