forked from mongodb/amboy
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathformats.go
More file actions
31 lines (28 loc) · 703 Bytes
/
formats.go
File metadata and controls
31 lines (28 loc) · 703 Bytes
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
package amboy
// Format defines a sequence of constants used to distinguish between
// different serialization formats for job objects used in the
// amboy.ConvertTo and amboy.ConvertFrom functions, which support the
// functionality of the Export and Import methods in the job
// interface.
type Format int
// Supported values of the Format type, which represent different
// supported serialization methods..
const (
BSON Format = iota
YAML
JSON
BSON2
)
// String implements fmt.Stringer and pretty prints the format name.
func (f Format) String() string {
switch f {
case JSON:
return "json"
case BSON, BSON2:
return "bson"
case YAML:
return "yaml"
default:
return "INVALID"
}
}