github.com/keybase/client/go@v0.0.0-20241007131713-f10651d043c8/protocol/gregor1/common.go (about) 1 // Auto-generated to Go types and interfaces using avdl-compiler v1.4.10 (https://github.com/keybase/node-avdl-compiler) 2 // Input file: avdl/gregor1/common.avdl 3 4 package gregor1 5 6 import ( 7 "github.com/keybase/go-framed-msgpack-rpc/rpc" 8 ) 9 10 type TimeOrOffset struct { 11 Time_ Time `codec:"time" json:"time"` 12 Offset_ DurationMsec `codec:"offset" json:"offset"` 13 } 14 15 func (o TimeOrOffset) DeepCopy() TimeOrOffset { 16 return TimeOrOffset{ 17 Time_: o.Time_.DeepCopy(), 18 Offset_: o.Offset_.DeepCopy(), 19 } 20 } 21 22 type Metadata struct { 23 Uid_ UID `codec:"uid" json:"uid"` 24 MsgID_ MsgID `codec:"msgID" json:"msgID"` 25 Ctime_ Time `codec:"ctime" json:"ctime"` 26 DeviceID_ DeviceID `codec:"deviceID" json:"deviceID"` 27 InBandMsgType_ int `codec:"inBandMsgType" json:"inBandMsgType"` 28 } 29 30 func (o Metadata) DeepCopy() Metadata { 31 return Metadata{ 32 Uid_: o.Uid_.DeepCopy(), 33 MsgID_: o.MsgID_.DeepCopy(), 34 Ctime_: o.Ctime_.DeepCopy(), 35 DeviceID_: o.DeviceID_.DeepCopy(), 36 InBandMsgType_: o.InBandMsgType_, 37 } 38 } 39 40 type InBandMessage struct { 41 StateUpdate_ *StateUpdateMessage `codec:"stateUpdate,omitempty" json:"stateUpdate,omitempty"` 42 StateSync_ *StateSyncMessage `codec:"stateSync,omitempty" json:"stateSync,omitempty"` 43 } 44 45 func (o InBandMessage) DeepCopy() InBandMessage { 46 return InBandMessage{ 47 StateUpdate_: (func(x *StateUpdateMessage) *StateUpdateMessage { 48 if x == nil { 49 return nil 50 } 51 tmp := (*x).DeepCopy() 52 return &tmp 53 })(o.StateUpdate_), 54 StateSync_: (func(x *StateSyncMessage) *StateSyncMessage { 55 if x == nil { 56 return nil 57 } 58 tmp := (*x).DeepCopy() 59 return &tmp 60 })(o.StateSync_), 61 } 62 } 63 64 type State struct { 65 Items_ []ItemAndMetadata `codec:"items" json:"items"` 66 } 67 68 func (o State) DeepCopy() State { 69 return State{ 70 Items_: (func(x []ItemAndMetadata) []ItemAndMetadata { 71 if x == nil { 72 return nil 73 } 74 ret := make([]ItemAndMetadata, len(x)) 75 for i, v := range x { 76 vCopy := v.DeepCopy() 77 ret[i] = vCopy 78 } 79 return ret 80 })(o.Items_), 81 } 82 } 83 84 type StateUpdateMessage struct { 85 Md_ Metadata `codec:"md" json:"md"` 86 Creation_ *Item `codec:"creation,omitempty" json:"creation,omitempty"` 87 Dismissal_ *Dismissal `codec:"dismissal,omitempty" json:"dismissal,omitempty"` 88 } 89 90 func (o StateUpdateMessage) DeepCopy() StateUpdateMessage { 91 return StateUpdateMessage{ 92 Md_: o.Md_.DeepCopy(), 93 Creation_: (func(x *Item) *Item { 94 if x == nil { 95 return nil 96 } 97 tmp := (*x).DeepCopy() 98 return &tmp 99 })(o.Creation_), 100 Dismissal_: (func(x *Dismissal) *Dismissal { 101 if x == nil { 102 return nil 103 } 104 tmp := (*x).DeepCopy() 105 return &tmp 106 })(o.Dismissal_), 107 } 108 } 109 110 type StateSyncMessage struct { 111 Md_ Metadata `codec:"md" json:"md"` 112 } 113 114 func (o StateSyncMessage) DeepCopy() StateSyncMessage { 115 return StateSyncMessage{ 116 Md_: o.Md_.DeepCopy(), 117 } 118 } 119 120 type MsgRange struct { 121 EndTime_ TimeOrOffset `codec:"endTime" json:"endTime"` 122 Category_ Category `codec:"category" json:"category"` 123 SkipMsgIDs_ []MsgID `codec:"skipMsgIDs" json:"skipMsgIDs"` 124 } 125 126 func (o MsgRange) DeepCopy() MsgRange { 127 return MsgRange{ 128 EndTime_: o.EndTime_.DeepCopy(), 129 Category_: o.Category_.DeepCopy(), 130 SkipMsgIDs_: (func(x []MsgID) []MsgID { 131 if x == nil { 132 return nil 133 } 134 ret := make([]MsgID, len(x)) 135 for i, v := range x { 136 vCopy := v.DeepCopy() 137 ret[i] = vCopy 138 } 139 return ret 140 })(o.SkipMsgIDs_), 141 } 142 } 143 144 type Dismissal struct { 145 MsgIDs_ []MsgID `codec:"msgIDs" json:"msgIDs"` 146 Ranges_ []MsgRange `codec:"ranges" json:"ranges"` 147 } 148 149 func (o Dismissal) DeepCopy() Dismissal { 150 return Dismissal{ 151 MsgIDs_: (func(x []MsgID) []MsgID { 152 if x == nil { 153 return nil 154 } 155 ret := make([]MsgID, len(x)) 156 for i, v := range x { 157 vCopy := v.DeepCopy() 158 ret[i] = vCopy 159 } 160 return ret 161 })(o.MsgIDs_), 162 Ranges_: (func(x []MsgRange) []MsgRange { 163 if x == nil { 164 return nil 165 } 166 ret := make([]MsgRange, len(x)) 167 for i, v := range x { 168 vCopy := v.DeepCopy() 169 ret[i] = vCopy 170 } 171 return ret 172 })(o.Ranges_), 173 } 174 } 175 176 type Item struct { 177 Category_ Category `codec:"category" json:"category"` 178 Dtime_ TimeOrOffset `codec:"dtime" json:"dtime"` 179 RemindTimes_ []TimeOrOffset `codec:"remindTimes" json:"remindTimes"` 180 Body_ Body `codec:"body" json:"body"` 181 } 182 183 func (o Item) DeepCopy() Item { 184 return Item{ 185 Category_: o.Category_.DeepCopy(), 186 Dtime_: o.Dtime_.DeepCopy(), 187 RemindTimes_: (func(x []TimeOrOffset) []TimeOrOffset { 188 if x == nil { 189 return nil 190 } 191 ret := make([]TimeOrOffset, len(x)) 192 for i, v := range x { 193 vCopy := v.DeepCopy() 194 ret[i] = vCopy 195 } 196 return ret 197 })(o.RemindTimes_), 198 Body_: o.Body_.DeepCopy(), 199 } 200 } 201 202 type ItemAndMetadata struct { 203 Md_ *Metadata `codec:"md,omitempty" json:"md,omitempty"` 204 Item_ *Item `codec:"item,omitempty" json:"item,omitempty"` 205 } 206 207 func (o ItemAndMetadata) DeepCopy() ItemAndMetadata { 208 return ItemAndMetadata{ 209 Md_: (func(x *Metadata) *Metadata { 210 if x == nil { 211 return nil 212 } 213 tmp := (*x).DeepCopy() 214 return &tmp 215 })(o.Md_), 216 Item_: (func(x *Item) *Item { 217 if x == nil { 218 return nil 219 } 220 tmp := (*x).DeepCopy() 221 return &tmp 222 })(o.Item_), 223 } 224 } 225 226 type Reminder struct { 227 Item_ ItemAndMetadata `codec:"item" json:"item"` 228 Seqno_ int `codec:"seqno" json:"seqno"` 229 RemindTime_ Time `codec:"remindTime" json:"remindTime"` 230 } 231 232 func (o Reminder) DeepCopy() Reminder { 233 return Reminder{ 234 Item_: o.Item_.DeepCopy(), 235 Seqno_: o.Seqno_, 236 RemindTime_: o.RemindTime_.DeepCopy(), 237 } 238 } 239 240 type ReminderID struct { 241 Uid_ UID `codec:"uid" json:"uid"` 242 MsgID_ MsgID `codec:"msgID" json:"msgID"` 243 Seqno_ int `codec:"seqno" json:"seqno"` 244 } 245 246 func (o ReminderID) DeepCopy() ReminderID { 247 return ReminderID{ 248 Uid_: o.Uid_.DeepCopy(), 249 MsgID_: o.MsgID_.DeepCopy(), 250 Seqno_: o.Seqno_, 251 } 252 } 253 254 type OutOfBandMessage struct { 255 Uid_ UID `codec:"uid" json:"uid"` 256 System_ System `codec:"system" json:"system"` 257 Body_ Body `codec:"body" json:"body"` 258 } 259 260 func (o OutOfBandMessage) DeepCopy() OutOfBandMessage { 261 return OutOfBandMessage{ 262 Uid_: o.Uid_.DeepCopy(), 263 System_: o.System_.DeepCopy(), 264 Body_: o.Body_.DeepCopy(), 265 } 266 } 267 268 type ReminderSet struct { 269 Reminders_ []Reminder `codec:"reminders" json:"reminders"` 270 MoreRemindersReady_ bool `codec:"moreRemindersReady" json:"moreRemindersReady"` 271 } 272 273 func (o ReminderSet) DeepCopy() ReminderSet { 274 return ReminderSet{ 275 Reminders_: (func(x []Reminder) []Reminder { 276 if x == nil { 277 return nil 278 } 279 ret := make([]Reminder, len(x)) 280 for i, v := range x { 281 vCopy := v.DeepCopy() 282 ret[i] = vCopy 283 } 284 return ret 285 })(o.Reminders_), 286 MoreRemindersReady_: o.MoreRemindersReady_, 287 } 288 } 289 290 type Message struct { 291 Oobm_ *OutOfBandMessage `codec:"oobm,omitempty" json:"oobm,omitempty"` 292 Ibm_ *InBandMessage `codec:"ibm,omitempty" json:"ibm,omitempty"` 293 } 294 295 func (o Message) DeepCopy() Message { 296 return Message{ 297 Oobm_: (func(x *OutOfBandMessage) *OutOfBandMessage { 298 if x == nil { 299 return nil 300 } 301 tmp := (*x).DeepCopy() 302 return &tmp 303 })(o.Oobm_), 304 Ibm_: (func(x *InBandMessage) *InBandMessage { 305 if x == nil { 306 return nil 307 } 308 tmp := (*x).DeepCopy() 309 return &tmp 310 })(o.Ibm_), 311 } 312 } 313 314 type DurationMsec int64 315 316 func (o DurationMsec) DeepCopy() DurationMsec { 317 return o 318 } 319 320 type DurationSec int64 321 322 func (o DurationSec) DeepCopy() DurationSec { 323 return o 324 } 325 326 type Category string 327 328 func (o Category) DeepCopy() Category { 329 return o 330 } 331 332 type System string 333 334 func (o System) DeepCopy() System { 335 return o 336 } 337 338 type UID []byte 339 340 func (o UID) DeepCopy() UID { 341 return (func(x []byte) []byte { 342 if x == nil { 343 return nil 344 } 345 return append([]byte{}, x...) 346 })(o) 347 } 348 349 type MsgID []byte 350 351 func (o MsgID) DeepCopy() MsgID { 352 return (func(x []byte) []byte { 353 if x == nil { 354 return nil 355 } 356 return append([]byte{}, x...) 357 })(o) 358 } 359 360 type DeviceID []byte 361 362 func (o DeviceID) DeepCopy() DeviceID { 363 return (func(x []byte) []byte { 364 if x == nil { 365 return nil 366 } 367 return append([]byte{}, x...) 368 })(o) 369 } 370 371 type Body []byte 372 373 func (o Body) DeepCopy() Body { 374 return (func(x []byte) []byte { 375 if x == nil { 376 return nil 377 } 378 return append([]byte{}, x...) 379 })(o) 380 } 381 382 type Time int64 383 384 func (o Time) DeepCopy() Time { 385 return o 386 } 387 388 type SessionID string 389 390 func (o SessionID) DeepCopy() SessionID { 391 return o 392 } 393 394 type SessionToken string 395 396 func (o SessionToken) DeepCopy() SessionToken { 397 return o 398 } 399 400 type CommonInterface interface { 401 } 402 403 func CommonProtocol(i CommonInterface) rpc.Protocol { 404 return rpc.Protocol{ 405 Name: "gregor.1.common", 406 Methods: map[string]rpc.ServeHandlerDescription{}, 407 } 408 } 409 410 type CommonClient struct { 411 Cli rpc.GenericClient 412 }