-
Notifications
You must be signed in to change notification settings - Fork 143
/
gen_hyperloglog.go
152 lines (127 loc) · 3 KB
/
gen_hyperloglog.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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
// Code generated DO NOT EDIT
package cmds
type Pfadd Incomplete
func (b Builder) Pfadd() (c Pfadd) {
c = Pfadd{cs: get(), ks: b.ks}
c.cs.s = append(c.cs.s, "PFADD")
return c
}
func (c Pfadd) Key(key string) PfaddKey {
if c.ks&NoSlot == NoSlot {
c.ks = NoSlot | slot(key)
} else {
c.ks = check(c.ks, slot(key))
}
c.cs.s = append(c.cs.s, key)
return (PfaddKey)(c)
}
type PfaddElement Incomplete
func (c PfaddElement) Element(element ...string) PfaddElement {
c.cs.s = append(c.cs.s, element...)
return c
}
func (c PfaddElement) Build() Completed {
c.cs.Build()
return Completed{cs: c.cs, cf: uint16(c.cf), ks: c.ks}
}
type PfaddKey Incomplete
func (c PfaddKey) Element(element ...string) PfaddElement {
c.cs.s = append(c.cs.s, element...)
return (PfaddElement)(c)
}
func (c PfaddKey) Build() Completed {
c.cs.Build()
return Completed{cs: c.cs, cf: uint16(c.cf), ks: c.ks}
}
type Pfcount Incomplete
func (b Builder) Pfcount() (c Pfcount) {
c = Pfcount{cs: get(), ks: b.ks, cf: int16(readonly)}
c.cs.s = append(c.cs.s, "PFCOUNT")
return c
}
func (c Pfcount) Key(key ...string) PfcountKey {
if c.ks&NoSlot == NoSlot {
for _, k := range key {
c.ks = NoSlot | slot(k)
break
}
} else {
for _, k := range key {
c.ks = check(c.ks, slot(k))
}
}
c.cs.s = append(c.cs.s, key...)
return (PfcountKey)(c)
}
type PfcountKey Incomplete
func (c PfcountKey) Key(key ...string) PfcountKey {
if c.ks&NoSlot == NoSlot {
for _, k := range key {
c.ks = NoSlot | slot(k)
break
}
} else {
for _, k := range key {
c.ks = check(c.ks, slot(k))
}
}
c.cs.s = append(c.cs.s, key...)
return c
}
func (c PfcountKey) Build() Completed {
c.cs.Build()
return Completed{cs: c.cs, cf: uint16(c.cf), ks: c.ks}
}
type Pfmerge Incomplete
func (b Builder) Pfmerge() (c Pfmerge) {
c = Pfmerge{cs: get(), ks: b.ks}
c.cs.s = append(c.cs.s, "PFMERGE")
return c
}
func (c Pfmerge) Destkey(destkey string) PfmergeDestkey {
if c.ks&NoSlot == NoSlot {
c.ks = NoSlot | slot(destkey)
} else {
c.ks = check(c.ks, slot(destkey))
}
c.cs.s = append(c.cs.s, destkey)
return (PfmergeDestkey)(c)
}
type PfmergeDestkey Incomplete
func (c PfmergeDestkey) Sourcekey(sourcekey ...string) PfmergeSourcekey {
if c.ks&NoSlot == NoSlot {
for _, k := range sourcekey {
c.ks = NoSlot | slot(k)
break
}
} else {
for _, k := range sourcekey {
c.ks = check(c.ks, slot(k))
}
}
c.cs.s = append(c.cs.s, sourcekey...)
return (PfmergeSourcekey)(c)
}
func (c PfmergeDestkey) Build() Completed {
c.cs.Build()
return Completed{cs: c.cs, cf: uint16(c.cf), ks: c.ks}
}
type PfmergeSourcekey Incomplete
func (c PfmergeSourcekey) Sourcekey(sourcekey ...string) PfmergeSourcekey {
if c.ks&NoSlot == NoSlot {
for _, k := range sourcekey {
c.ks = NoSlot | slot(k)
break
}
} else {
for _, k := range sourcekey {
c.ks = check(c.ks, slot(k))
}
}
c.cs.s = append(c.cs.s, sourcekey...)
return c
}
func (c PfmergeSourcekey) Build() Completed {
c.cs.Build()
return Completed{cs: c.cs, cf: uint16(c.cf), ks: c.ks}
}