-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathranges.go
81 lines (77 loc) · 1.18 KB
/
ranges.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
package isbn
type PrefixeItem struct {
Prefix string
Agency string
Rules []*Rule
}
type Rule struct {
Range string
Length string
}
type GroupItem struct {
Prefix string
Agency string
Rules []*Rule
}
var prefixes = []PrefixeItem{
PrefixeItem{
Prefix: "978",
Agency: "International ISBN Agency",
Rules: []*Rule{
&Rule{
Range: "0000000-5999999",
Length: "1",
},
&Rule{
Range: "6000000-6499999",
Length: "3",
},
&Rule{
Range: "6500000-6599999",
Length: "2",
},
&Rule{
Range: "6600000-6999999",
Length: "0",
},
&Rule{
Range: "7000000-7999999",
Length: "1",
},
&Rule{
Range: "8000000-9499999",
Length: "2",
},
&Rule{
Range: "9500000-9899999",
Length: "3",
},
&Rule{
Range: "9900000-9989999",
Length: "4",
},
&Rule{
Range: "9990000-9999999",
Length: "5",
},
},
},
PrefixeItem{
Prefix: "979",
Agency: "International ISBN Agency",
Rules: []*Rule{
&Rule{
Range: "0000000-0999999",
Length: "0",
},
&Rule{
Range: "1000000-1299999",
Length: "2",
},
&Rule{
Range: "1300000-9999999",
Length: "0",
},
},
},
}