github.com/keybase/client/go@v0.0.0-20240309051027-028f7c731f8b/protocol/keybase1/metadata.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/keybase1/metadata.avdl 3 4 package keybase1 5 6 import ( 7 "github.com/keybase/go-framed-msgpack-rpc/rpc" 8 context "golang.org/x/net/context" 9 "time" 10 ) 11 12 type KeyHalf struct { 13 User UID `codec:"user" json:"user"` 14 DeviceKID KID `codec:"deviceKID" json:"deviceKID"` 15 Key []byte `codec:"key" json:"key"` 16 } 17 18 func (o KeyHalf) DeepCopy() KeyHalf { 19 return KeyHalf{ 20 User: o.User.DeepCopy(), 21 DeviceKID: o.DeviceKID.DeepCopy(), 22 Key: (func(x []byte) []byte { 23 if x == nil { 24 return nil 25 } 26 return append([]byte{}, x...) 27 })(o.Key), 28 } 29 } 30 31 type MDBlock struct { 32 Version int `codec:"version" json:"version"` 33 Timestamp Time `codec:"timestamp" json:"timestamp"` 34 Block []byte `codec:"block" json:"block"` 35 } 36 37 func (o MDBlock) DeepCopy() MDBlock { 38 return MDBlock{ 39 Version: o.Version, 40 Timestamp: o.Timestamp.DeepCopy(), 41 Block: (func(x []byte) []byte { 42 if x == nil { 43 return nil 44 } 45 return append([]byte{}, x...) 46 })(o.Block), 47 } 48 } 49 50 type KeyBundle struct { 51 Version int `codec:"version" json:"version"` 52 Bundle []byte `codec:"bundle" json:"bundle"` 53 } 54 55 func (o KeyBundle) DeepCopy() KeyBundle { 56 return KeyBundle{ 57 Version: o.Version, 58 Bundle: (func(x []byte) []byte { 59 if x == nil { 60 return nil 61 } 62 return append([]byte{}, x...) 63 })(o.Bundle), 64 } 65 } 66 67 type MetadataResponse struct { 68 FolderID string `codec:"folderID" json:"folderID"` 69 MdBlocks []MDBlock `codec:"mdBlocks" json:"mdBlocks"` 70 } 71 72 func (o MetadataResponse) DeepCopy() MetadataResponse { 73 return MetadataResponse{ 74 FolderID: o.FolderID, 75 MdBlocks: (func(x []MDBlock) []MDBlock { 76 if x == nil { 77 return nil 78 } 79 ret := make([]MDBlock, len(x)) 80 for i, v := range x { 81 vCopy := v.DeepCopy() 82 ret[i] = vCopy 83 } 84 return ret 85 })(o.MdBlocks), 86 } 87 } 88 89 type MerkleRoot struct { 90 Version int `codec:"version" json:"version"` 91 Root []byte `codec:"root" json:"root"` 92 } 93 94 func (o MerkleRoot) DeepCopy() MerkleRoot { 95 return MerkleRoot{ 96 Version: o.Version, 97 Root: (func(x []byte) []byte { 98 if x == nil { 99 return nil 100 } 101 return append([]byte{}, x...) 102 })(o.Root), 103 } 104 } 105 106 type PingResponse struct { 107 Timestamp Time `codec:"timestamp" json:"timestamp"` 108 } 109 110 func (o PingResponse) DeepCopy() PingResponse { 111 return PingResponse{ 112 Timestamp: o.Timestamp.DeepCopy(), 113 } 114 } 115 116 type KeyBundleResponse struct { 117 WriterBundle KeyBundle `codec:"WriterBundle" json:"WriterBundle"` 118 ReaderBundle KeyBundle `codec:"ReaderBundle" json:"ReaderBundle"` 119 } 120 121 func (o KeyBundleResponse) DeepCopy() KeyBundleResponse { 122 return KeyBundleResponse{ 123 WriterBundle: o.WriterBundle.DeepCopy(), 124 ReaderBundle: o.ReaderBundle.DeepCopy(), 125 } 126 } 127 128 type LockID int64 129 130 func (o LockID) DeepCopy() LockID { 131 return o 132 } 133 134 type MDPriority int 135 136 func (o MDPriority) DeepCopy() MDPriority { 137 return o 138 } 139 140 type LockContext struct { 141 RequireLockID LockID `codec:"requireLockID" json:"requireLockID"` 142 ReleaseAfterSuccess bool `codec:"releaseAfterSuccess" json:"releaseAfterSuccess"` 143 } 144 145 func (o LockContext) DeepCopy() LockContext { 146 return LockContext{ 147 RequireLockID: o.RequireLockID.DeepCopy(), 148 ReleaseAfterSuccess: o.ReleaseAfterSuccess, 149 } 150 } 151 152 type FindNextMDResponse struct { 153 KbfsRoot MerkleRoot `codec:"kbfsRoot" json:"kbfsRoot"` 154 MerkleNodes [][]byte `codec:"merkleNodes" json:"merkleNodes"` 155 RootSeqno Seqno `codec:"rootSeqno" json:"rootSeqno"` 156 RootHash HashMeta `codec:"rootHash" json:"rootHash"` 157 } 158 159 func (o FindNextMDResponse) DeepCopy() FindNextMDResponse { 160 return FindNextMDResponse{ 161 KbfsRoot: o.KbfsRoot.DeepCopy(), 162 MerkleNodes: (func(x [][]byte) [][]byte { 163 if x == nil { 164 return nil 165 } 166 ret := make([][]byte, len(x)) 167 for i, v := range x { 168 vCopy := (func(x []byte) []byte { 169 if x == nil { 170 return nil 171 } 172 return append([]byte{}, x...) 173 })(v) 174 ret[i] = vCopy 175 } 176 return ret 177 })(o.MerkleNodes), 178 RootSeqno: o.RootSeqno.DeepCopy(), 179 RootHash: o.RootHash.DeepCopy(), 180 } 181 } 182 183 type GetChallengeArg struct { 184 } 185 186 type AuthenticateArg struct { 187 Signature string `codec:"signature" json:"signature"` 188 } 189 190 type PutMetadataArg struct { 191 MdBlock MDBlock `codec:"mdBlock" json:"mdBlock"` 192 ReaderKeyBundle KeyBundle `codec:"readerKeyBundle" json:"readerKeyBundle"` 193 WriterKeyBundle KeyBundle `codec:"writerKeyBundle" json:"writerKeyBundle"` 194 LogTags map[string]string `codec:"logTags" json:"logTags"` 195 LockContext *LockContext `codec:"lockContext,omitempty" json:"lockContext,omitempty"` 196 Priority MDPriority `codec:"priority" json:"priority"` 197 } 198 199 type GetMetadataArg struct { 200 FolderID string `codec:"folderID" json:"folderID"` 201 FolderHandle []byte `codec:"folderHandle" json:"folderHandle"` 202 BranchID string `codec:"branchID" json:"branchID"` 203 Unmerged bool `codec:"unmerged" json:"unmerged"` 204 StartRevision int64 `codec:"startRevision" json:"startRevision"` 205 StopRevision int64 `codec:"stopRevision" json:"stopRevision"` 206 LogTags map[string]string `codec:"logTags" json:"logTags"` 207 LockBeforeGet *LockID `codec:"lockBeforeGet,omitempty" json:"lockBeforeGet,omitempty"` 208 } 209 210 type GetMetadataByTimestampArg struct { 211 FolderID string `codec:"folderID" json:"folderID"` 212 ServerTime Time `codec:"serverTime" json:"serverTime"` 213 } 214 215 type RegisterForUpdatesArg struct { 216 FolderID string `codec:"folderID" json:"folderID"` 217 CurrRevision int64 `codec:"currRevision" json:"currRevision"` 218 LogTags map[string]string `codec:"logTags" json:"logTags"` 219 } 220 221 type PruneBranchArg struct { 222 FolderID string `codec:"folderID" json:"folderID"` 223 BranchID string `codec:"branchID" json:"branchID"` 224 LogTags map[string]string `codec:"logTags" json:"logTags"` 225 } 226 227 type PutKeysArg struct { 228 KeyHalves []KeyHalf `codec:"keyHalves" json:"keyHalves"` 229 LogTags map[string]string `codec:"logTags" json:"logTags"` 230 } 231 232 type GetKeyArg struct { 233 KeyHalfID []byte `codec:"keyHalfID" json:"keyHalfID"` 234 DeviceKID string `codec:"deviceKID" json:"deviceKID"` 235 LogTags map[string]string `codec:"logTags" json:"logTags"` 236 } 237 238 type DeleteKeyArg struct { 239 Uid UID `codec:"uid" json:"uid"` 240 DeviceKID KID `codec:"deviceKID" json:"deviceKID"` 241 KeyHalfID []byte `codec:"keyHalfID" json:"keyHalfID"` 242 LogTags map[string]string `codec:"logTags" json:"logTags"` 243 } 244 245 type TruncateLockArg struct { 246 FolderID string `codec:"folderID" json:"folderID"` 247 } 248 249 type TruncateUnlockArg struct { 250 FolderID string `codec:"folderID" json:"folderID"` 251 } 252 253 type GetFolderHandleArg struct { 254 FolderID string `codec:"folderID" json:"folderID"` 255 Signature string `codec:"signature" json:"signature"` 256 Challenge string `codec:"challenge" json:"challenge"` 257 } 258 259 type GetFoldersForRekeyArg struct { 260 DeviceKID KID `codec:"deviceKID" json:"deviceKID"` 261 } 262 263 type PingArg struct { 264 } 265 266 type Ping2Arg struct { 267 } 268 269 type GetLatestFolderHandleArg struct { 270 FolderID string `codec:"folderID" json:"folderID"` 271 } 272 273 type GetKeyBundlesArg struct { 274 FolderID string `codec:"folderID" json:"folderID"` 275 WriterBundleID string `codec:"writerBundleID" json:"writerBundleID"` 276 ReaderBundleID string `codec:"readerBundleID" json:"readerBundleID"` 277 } 278 279 type LockArg struct { 280 FolderID string `codec:"folderID" json:"folderID"` 281 LockID LockID `codec:"lockID" json:"lockID"` 282 } 283 284 type ReleaseLockArg struct { 285 FolderID string `codec:"folderID" json:"folderID"` 286 LockID LockID `codec:"lockID" json:"lockID"` 287 } 288 289 type StartImplicitTeamMigrationArg struct { 290 FolderID string `codec:"folderID" json:"folderID"` 291 } 292 293 type GetMerkleRootArg struct { 294 TreeID MerkleTreeID `codec:"treeID" json:"treeID"` 295 SeqNo int64 `codec:"seqNo" json:"seqNo"` 296 } 297 298 type GetMerkleRootLatestArg struct { 299 TreeID MerkleTreeID `codec:"treeID" json:"treeID"` 300 } 301 302 type GetMerkleRootSinceArg struct { 303 TreeID MerkleTreeID `codec:"treeID" json:"treeID"` 304 When Time `codec:"when" json:"when"` 305 } 306 307 type GetMerkleNodeArg struct { 308 Hash string `codec:"hash" json:"hash"` 309 } 310 311 type FindNextMDArg struct { 312 Seqno Seqno `codec:"seqno" json:"seqno"` 313 FolderID string `codec:"folderID" json:"folderID"` 314 } 315 316 type SetImplicitTeamModeForTestArg struct { 317 ImplicitTeamMode string `codec:"implicitTeamMode" json:"implicitTeamMode"` 318 } 319 320 type ForceMerkleBuildForTestArg struct { 321 } 322 323 type MetadataInterface interface { 324 GetChallenge(context.Context) (ChallengeInfo, error) 325 Authenticate(context.Context, string) (int, error) 326 PutMetadata(context.Context, PutMetadataArg) error 327 GetMetadata(context.Context, GetMetadataArg) (MetadataResponse, error) 328 GetMetadataByTimestamp(context.Context, GetMetadataByTimestampArg) (MDBlock, error) 329 RegisterForUpdates(context.Context, RegisterForUpdatesArg) error 330 PruneBranch(context.Context, PruneBranchArg) error 331 PutKeys(context.Context, PutKeysArg) error 332 GetKey(context.Context, GetKeyArg) ([]byte, error) 333 DeleteKey(context.Context, DeleteKeyArg) error 334 TruncateLock(context.Context, string) (bool, error) 335 TruncateUnlock(context.Context, string) (bool, error) 336 GetFolderHandle(context.Context, GetFolderHandleArg) ([]byte, error) 337 GetFoldersForRekey(context.Context, KID) error 338 Ping(context.Context) error 339 Ping2(context.Context) (PingResponse, error) 340 GetLatestFolderHandle(context.Context, string) ([]byte, error) 341 GetKeyBundles(context.Context, GetKeyBundlesArg) (KeyBundleResponse, error) 342 Lock(context.Context, LockArg) error 343 ReleaseLock(context.Context, ReleaseLockArg) error 344 StartImplicitTeamMigration(context.Context, string) error 345 GetMerkleRoot(context.Context, GetMerkleRootArg) (MerkleRoot, error) 346 GetMerkleRootLatest(context.Context, MerkleTreeID) (MerkleRoot, error) 347 GetMerkleRootSince(context.Context, GetMerkleRootSinceArg) (MerkleRoot, error) 348 GetMerkleNode(context.Context, string) ([]byte, error) 349 FindNextMD(context.Context, FindNextMDArg) (FindNextMDResponse, error) 350 SetImplicitTeamModeForTest(context.Context, string) error 351 ForceMerkleBuildForTest(context.Context) error 352 } 353 354 func MetadataProtocol(i MetadataInterface) rpc.Protocol { 355 return rpc.Protocol{ 356 Name: "keybase.1.metadata", 357 Methods: map[string]rpc.ServeHandlerDescription{ 358 "getChallenge": { 359 MakeArg: func() interface{} { 360 var ret [1]GetChallengeArg 361 return &ret 362 }, 363 Handler: func(ctx context.Context, args interface{}) (ret interface{}, err error) { 364 ret, err = i.GetChallenge(ctx) 365 return 366 }, 367 }, 368 "authenticate": { 369 MakeArg: func() interface{} { 370 var ret [1]AuthenticateArg 371 return &ret 372 }, 373 Handler: func(ctx context.Context, args interface{}) (ret interface{}, err error) { 374 typedArgs, ok := args.(*[1]AuthenticateArg) 375 if !ok { 376 err = rpc.NewTypeError((*[1]AuthenticateArg)(nil), args) 377 return 378 } 379 ret, err = i.Authenticate(ctx, typedArgs[0].Signature) 380 return 381 }, 382 }, 383 "putMetadata": { 384 MakeArg: func() interface{} { 385 var ret [1]PutMetadataArg 386 return &ret 387 }, 388 Handler: func(ctx context.Context, args interface{}) (ret interface{}, err error) { 389 typedArgs, ok := args.(*[1]PutMetadataArg) 390 if !ok { 391 err = rpc.NewTypeError((*[1]PutMetadataArg)(nil), args) 392 return 393 } 394 err = i.PutMetadata(ctx, typedArgs[0]) 395 return 396 }, 397 }, 398 "getMetadata": { 399 MakeArg: func() interface{} { 400 var ret [1]GetMetadataArg 401 return &ret 402 }, 403 Handler: func(ctx context.Context, args interface{}) (ret interface{}, err error) { 404 typedArgs, ok := args.(*[1]GetMetadataArg) 405 if !ok { 406 err = rpc.NewTypeError((*[1]GetMetadataArg)(nil), args) 407 return 408 } 409 ret, err = i.GetMetadata(ctx, typedArgs[0]) 410 return 411 }, 412 }, 413 "getMetadataByTimestamp": { 414 MakeArg: func() interface{} { 415 var ret [1]GetMetadataByTimestampArg 416 return &ret 417 }, 418 Handler: func(ctx context.Context, args interface{}) (ret interface{}, err error) { 419 typedArgs, ok := args.(*[1]GetMetadataByTimestampArg) 420 if !ok { 421 err = rpc.NewTypeError((*[1]GetMetadataByTimestampArg)(nil), args) 422 return 423 } 424 ret, err = i.GetMetadataByTimestamp(ctx, typedArgs[0]) 425 return 426 }, 427 }, 428 "registerForUpdates": { 429 MakeArg: func() interface{} { 430 var ret [1]RegisterForUpdatesArg 431 return &ret 432 }, 433 Handler: func(ctx context.Context, args interface{}) (ret interface{}, err error) { 434 typedArgs, ok := args.(*[1]RegisterForUpdatesArg) 435 if !ok { 436 err = rpc.NewTypeError((*[1]RegisterForUpdatesArg)(nil), args) 437 return 438 } 439 err = i.RegisterForUpdates(ctx, typedArgs[0]) 440 return 441 }, 442 }, 443 "pruneBranch": { 444 MakeArg: func() interface{} { 445 var ret [1]PruneBranchArg 446 return &ret 447 }, 448 Handler: func(ctx context.Context, args interface{}) (ret interface{}, err error) { 449 typedArgs, ok := args.(*[1]PruneBranchArg) 450 if !ok { 451 err = rpc.NewTypeError((*[1]PruneBranchArg)(nil), args) 452 return 453 } 454 err = i.PruneBranch(ctx, typedArgs[0]) 455 return 456 }, 457 }, 458 "putKeys": { 459 MakeArg: func() interface{} { 460 var ret [1]PutKeysArg 461 return &ret 462 }, 463 Handler: func(ctx context.Context, args interface{}) (ret interface{}, err error) { 464 typedArgs, ok := args.(*[1]PutKeysArg) 465 if !ok { 466 err = rpc.NewTypeError((*[1]PutKeysArg)(nil), args) 467 return 468 } 469 err = i.PutKeys(ctx, typedArgs[0]) 470 return 471 }, 472 }, 473 "getKey": { 474 MakeArg: func() interface{} { 475 var ret [1]GetKeyArg 476 return &ret 477 }, 478 Handler: func(ctx context.Context, args interface{}) (ret interface{}, err error) { 479 typedArgs, ok := args.(*[1]GetKeyArg) 480 if !ok { 481 err = rpc.NewTypeError((*[1]GetKeyArg)(nil), args) 482 return 483 } 484 ret, err = i.GetKey(ctx, typedArgs[0]) 485 return 486 }, 487 }, 488 "deleteKey": { 489 MakeArg: func() interface{} { 490 var ret [1]DeleteKeyArg 491 return &ret 492 }, 493 Handler: func(ctx context.Context, args interface{}) (ret interface{}, err error) { 494 typedArgs, ok := args.(*[1]DeleteKeyArg) 495 if !ok { 496 err = rpc.NewTypeError((*[1]DeleteKeyArg)(nil), args) 497 return 498 } 499 err = i.DeleteKey(ctx, typedArgs[0]) 500 return 501 }, 502 }, 503 "truncateLock": { 504 MakeArg: func() interface{} { 505 var ret [1]TruncateLockArg 506 return &ret 507 }, 508 Handler: func(ctx context.Context, args interface{}) (ret interface{}, err error) { 509 typedArgs, ok := args.(*[1]TruncateLockArg) 510 if !ok { 511 err = rpc.NewTypeError((*[1]TruncateLockArg)(nil), args) 512 return 513 } 514 ret, err = i.TruncateLock(ctx, typedArgs[0].FolderID) 515 return 516 }, 517 }, 518 "truncateUnlock": { 519 MakeArg: func() interface{} { 520 var ret [1]TruncateUnlockArg 521 return &ret 522 }, 523 Handler: func(ctx context.Context, args interface{}) (ret interface{}, err error) { 524 typedArgs, ok := args.(*[1]TruncateUnlockArg) 525 if !ok { 526 err = rpc.NewTypeError((*[1]TruncateUnlockArg)(nil), args) 527 return 528 } 529 ret, err = i.TruncateUnlock(ctx, typedArgs[0].FolderID) 530 return 531 }, 532 }, 533 "getFolderHandle": { 534 MakeArg: func() interface{} { 535 var ret [1]GetFolderHandleArg 536 return &ret 537 }, 538 Handler: func(ctx context.Context, args interface{}) (ret interface{}, err error) { 539 typedArgs, ok := args.(*[1]GetFolderHandleArg) 540 if !ok { 541 err = rpc.NewTypeError((*[1]GetFolderHandleArg)(nil), args) 542 return 543 } 544 ret, err = i.GetFolderHandle(ctx, typedArgs[0]) 545 return 546 }, 547 }, 548 "getFoldersForRekey": { 549 MakeArg: func() interface{} { 550 var ret [1]GetFoldersForRekeyArg 551 return &ret 552 }, 553 Handler: func(ctx context.Context, args interface{}) (ret interface{}, err error) { 554 typedArgs, ok := args.(*[1]GetFoldersForRekeyArg) 555 if !ok { 556 err = rpc.NewTypeError((*[1]GetFoldersForRekeyArg)(nil), args) 557 return 558 } 559 err = i.GetFoldersForRekey(ctx, typedArgs[0].DeviceKID) 560 return 561 }, 562 }, 563 "ping": { 564 MakeArg: func() interface{} { 565 var ret [1]PingArg 566 return &ret 567 }, 568 Handler: func(ctx context.Context, args interface{}) (ret interface{}, err error) { 569 err = i.Ping(ctx) 570 return 571 }, 572 }, 573 "ping2": { 574 MakeArg: func() interface{} { 575 var ret [1]Ping2Arg 576 return &ret 577 }, 578 Handler: func(ctx context.Context, args interface{}) (ret interface{}, err error) { 579 ret, err = i.Ping2(ctx) 580 return 581 }, 582 }, 583 "getLatestFolderHandle": { 584 MakeArg: func() interface{} { 585 var ret [1]GetLatestFolderHandleArg 586 return &ret 587 }, 588 Handler: func(ctx context.Context, args interface{}) (ret interface{}, err error) { 589 typedArgs, ok := args.(*[1]GetLatestFolderHandleArg) 590 if !ok { 591 err = rpc.NewTypeError((*[1]GetLatestFolderHandleArg)(nil), args) 592 return 593 } 594 ret, err = i.GetLatestFolderHandle(ctx, typedArgs[0].FolderID) 595 return 596 }, 597 }, 598 "getKeyBundles": { 599 MakeArg: func() interface{} { 600 var ret [1]GetKeyBundlesArg 601 return &ret 602 }, 603 Handler: func(ctx context.Context, args interface{}) (ret interface{}, err error) { 604 typedArgs, ok := args.(*[1]GetKeyBundlesArg) 605 if !ok { 606 err = rpc.NewTypeError((*[1]GetKeyBundlesArg)(nil), args) 607 return 608 } 609 ret, err = i.GetKeyBundles(ctx, typedArgs[0]) 610 return 611 }, 612 }, 613 "lock": { 614 MakeArg: func() interface{} { 615 var ret [1]LockArg 616 return &ret 617 }, 618 Handler: func(ctx context.Context, args interface{}) (ret interface{}, err error) { 619 typedArgs, ok := args.(*[1]LockArg) 620 if !ok { 621 err = rpc.NewTypeError((*[1]LockArg)(nil), args) 622 return 623 } 624 err = i.Lock(ctx, typedArgs[0]) 625 return 626 }, 627 }, 628 "releaseLock": { 629 MakeArg: func() interface{} { 630 var ret [1]ReleaseLockArg 631 return &ret 632 }, 633 Handler: func(ctx context.Context, args interface{}) (ret interface{}, err error) { 634 typedArgs, ok := args.(*[1]ReleaseLockArg) 635 if !ok { 636 err = rpc.NewTypeError((*[1]ReleaseLockArg)(nil), args) 637 return 638 } 639 err = i.ReleaseLock(ctx, typedArgs[0]) 640 return 641 }, 642 }, 643 "startImplicitTeamMigration": { 644 MakeArg: func() interface{} { 645 var ret [1]StartImplicitTeamMigrationArg 646 return &ret 647 }, 648 Handler: func(ctx context.Context, args interface{}) (ret interface{}, err error) { 649 typedArgs, ok := args.(*[1]StartImplicitTeamMigrationArg) 650 if !ok { 651 err = rpc.NewTypeError((*[1]StartImplicitTeamMigrationArg)(nil), args) 652 return 653 } 654 err = i.StartImplicitTeamMigration(ctx, typedArgs[0].FolderID) 655 return 656 }, 657 }, 658 "getMerkleRoot": { 659 MakeArg: func() interface{} { 660 var ret [1]GetMerkleRootArg 661 return &ret 662 }, 663 Handler: func(ctx context.Context, args interface{}) (ret interface{}, err error) { 664 typedArgs, ok := args.(*[1]GetMerkleRootArg) 665 if !ok { 666 err = rpc.NewTypeError((*[1]GetMerkleRootArg)(nil), args) 667 return 668 } 669 ret, err = i.GetMerkleRoot(ctx, typedArgs[0]) 670 return 671 }, 672 }, 673 "getMerkleRootLatest": { 674 MakeArg: func() interface{} { 675 var ret [1]GetMerkleRootLatestArg 676 return &ret 677 }, 678 Handler: func(ctx context.Context, args interface{}) (ret interface{}, err error) { 679 typedArgs, ok := args.(*[1]GetMerkleRootLatestArg) 680 if !ok { 681 err = rpc.NewTypeError((*[1]GetMerkleRootLatestArg)(nil), args) 682 return 683 } 684 ret, err = i.GetMerkleRootLatest(ctx, typedArgs[0].TreeID) 685 return 686 }, 687 }, 688 "getMerkleRootSince": { 689 MakeArg: func() interface{} { 690 var ret [1]GetMerkleRootSinceArg 691 return &ret 692 }, 693 Handler: func(ctx context.Context, args interface{}) (ret interface{}, err error) { 694 typedArgs, ok := args.(*[1]GetMerkleRootSinceArg) 695 if !ok { 696 err = rpc.NewTypeError((*[1]GetMerkleRootSinceArg)(nil), args) 697 return 698 } 699 ret, err = i.GetMerkleRootSince(ctx, typedArgs[0]) 700 return 701 }, 702 }, 703 "getMerkleNode": { 704 MakeArg: func() interface{} { 705 var ret [1]GetMerkleNodeArg 706 return &ret 707 }, 708 Handler: func(ctx context.Context, args interface{}) (ret interface{}, err error) { 709 typedArgs, ok := args.(*[1]GetMerkleNodeArg) 710 if !ok { 711 err = rpc.NewTypeError((*[1]GetMerkleNodeArg)(nil), args) 712 return 713 } 714 ret, err = i.GetMerkleNode(ctx, typedArgs[0].Hash) 715 return 716 }, 717 }, 718 "findNextMD": { 719 MakeArg: func() interface{} { 720 var ret [1]FindNextMDArg 721 return &ret 722 }, 723 Handler: func(ctx context.Context, args interface{}) (ret interface{}, err error) { 724 typedArgs, ok := args.(*[1]FindNextMDArg) 725 if !ok { 726 err = rpc.NewTypeError((*[1]FindNextMDArg)(nil), args) 727 return 728 } 729 ret, err = i.FindNextMD(ctx, typedArgs[0]) 730 return 731 }, 732 }, 733 "setImplicitTeamModeForTest": { 734 MakeArg: func() interface{} { 735 var ret [1]SetImplicitTeamModeForTestArg 736 return &ret 737 }, 738 Handler: func(ctx context.Context, args interface{}) (ret interface{}, err error) { 739 typedArgs, ok := args.(*[1]SetImplicitTeamModeForTestArg) 740 if !ok { 741 err = rpc.NewTypeError((*[1]SetImplicitTeamModeForTestArg)(nil), args) 742 return 743 } 744 err = i.SetImplicitTeamModeForTest(ctx, typedArgs[0].ImplicitTeamMode) 745 return 746 }, 747 }, 748 "forceMerkleBuildForTest": { 749 MakeArg: func() interface{} { 750 var ret [1]ForceMerkleBuildForTestArg 751 return &ret 752 }, 753 Handler: func(ctx context.Context, args interface{}) (ret interface{}, err error) { 754 err = i.ForceMerkleBuildForTest(ctx) 755 return 756 }, 757 }, 758 }, 759 } 760 } 761 762 type MetadataClient struct { 763 Cli rpc.GenericClient 764 } 765 766 func (c MetadataClient) GetChallenge(ctx context.Context) (res ChallengeInfo, err error) { 767 err = c.Cli.CallCompressed(ctx, "keybase.1.metadata.getChallenge", []interface{}{GetChallengeArg{}}, &res, rpc.CompressionGzip, 0*time.Millisecond) 768 return 769 } 770 771 func (c MetadataClient) Authenticate(ctx context.Context, signature string) (res int, err error) { 772 __arg := AuthenticateArg{Signature: signature} 773 err = c.Cli.CallCompressed(ctx, "keybase.1.metadata.authenticate", []interface{}{__arg}, &res, rpc.CompressionGzip, 0*time.Millisecond) 774 return 775 } 776 777 func (c MetadataClient) PutMetadata(ctx context.Context, __arg PutMetadataArg) (err error) { 778 err = c.Cli.CallCompressed(ctx, "keybase.1.metadata.putMetadata", []interface{}{__arg}, nil, rpc.CompressionGzip, 0*time.Millisecond) 779 return 780 } 781 782 func (c MetadataClient) GetMetadata(ctx context.Context, __arg GetMetadataArg) (res MetadataResponse, err error) { 783 err = c.Cli.CallCompressed(ctx, "keybase.1.metadata.getMetadata", []interface{}{__arg}, &res, rpc.CompressionGzip, 0*time.Millisecond) 784 return 785 } 786 787 func (c MetadataClient) GetMetadataByTimestamp(ctx context.Context, __arg GetMetadataByTimestampArg) (res MDBlock, err error) { 788 err = c.Cli.CallCompressed(ctx, "keybase.1.metadata.getMetadataByTimestamp", []interface{}{__arg}, &res, rpc.CompressionGzip, 0*time.Millisecond) 789 return 790 } 791 792 func (c MetadataClient) RegisterForUpdates(ctx context.Context, __arg RegisterForUpdatesArg) (err error) { 793 err = c.Cli.CallCompressed(ctx, "keybase.1.metadata.registerForUpdates", []interface{}{__arg}, nil, rpc.CompressionGzip, 0*time.Millisecond) 794 return 795 } 796 797 func (c MetadataClient) PruneBranch(ctx context.Context, __arg PruneBranchArg) (err error) { 798 err = c.Cli.CallCompressed(ctx, "keybase.1.metadata.pruneBranch", []interface{}{__arg}, nil, rpc.CompressionGzip, 0*time.Millisecond) 799 return 800 } 801 802 func (c MetadataClient) PutKeys(ctx context.Context, __arg PutKeysArg) (err error) { 803 err = c.Cli.CallCompressed(ctx, "keybase.1.metadata.putKeys", []interface{}{__arg}, nil, rpc.CompressionGzip, 0*time.Millisecond) 804 return 805 } 806 807 func (c MetadataClient) GetKey(ctx context.Context, __arg GetKeyArg) (res []byte, err error) { 808 err = c.Cli.CallCompressed(ctx, "keybase.1.metadata.getKey", []interface{}{__arg}, &res, rpc.CompressionGzip, 0*time.Millisecond) 809 return 810 } 811 812 func (c MetadataClient) DeleteKey(ctx context.Context, __arg DeleteKeyArg) (err error) { 813 err = c.Cli.CallCompressed(ctx, "keybase.1.metadata.deleteKey", []interface{}{__arg}, nil, rpc.CompressionGzip, 0*time.Millisecond) 814 return 815 } 816 817 func (c MetadataClient) TruncateLock(ctx context.Context, folderID string) (res bool, err error) { 818 __arg := TruncateLockArg{FolderID: folderID} 819 err = c.Cli.CallCompressed(ctx, "keybase.1.metadata.truncateLock", []interface{}{__arg}, &res, rpc.CompressionGzip, 0*time.Millisecond) 820 return 821 } 822 823 func (c MetadataClient) TruncateUnlock(ctx context.Context, folderID string) (res bool, err error) { 824 __arg := TruncateUnlockArg{FolderID: folderID} 825 err = c.Cli.CallCompressed(ctx, "keybase.1.metadata.truncateUnlock", []interface{}{__arg}, &res, rpc.CompressionGzip, 0*time.Millisecond) 826 return 827 } 828 829 func (c MetadataClient) GetFolderHandle(ctx context.Context, __arg GetFolderHandleArg) (res []byte, err error) { 830 err = c.Cli.CallCompressed(ctx, "keybase.1.metadata.getFolderHandle", []interface{}{__arg}, &res, rpc.CompressionGzip, 0*time.Millisecond) 831 return 832 } 833 834 func (c MetadataClient) GetFoldersForRekey(ctx context.Context, deviceKID KID) (err error) { 835 __arg := GetFoldersForRekeyArg{DeviceKID: deviceKID} 836 err = c.Cli.CallCompressed(ctx, "keybase.1.metadata.getFoldersForRekey", []interface{}{__arg}, nil, rpc.CompressionGzip, 0*time.Millisecond) 837 return 838 } 839 840 func (c MetadataClient) Ping(ctx context.Context) (err error) { 841 err = c.Cli.CallCompressed(ctx, "keybase.1.metadata.ping", []interface{}{PingArg{}}, nil, rpc.CompressionGzip, 0*time.Millisecond) 842 return 843 } 844 845 func (c MetadataClient) Ping2(ctx context.Context) (res PingResponse, err error) { 846 err = c.Cli.CallCompressed(ctx, "keybase.1.metadata.ping2", []interface{}{Ping2Arg{}}, &res, rpc.CompressionGzip, 0*time.Millisecond) 847 return 848 } 849 850 func (c MetadataClient) GetLatestFolderHandle(ctx context.Context, folderID string) (res []byte, err error) { 851 __arg := GetLatestFolderHandleArg{FolderID: folderID} 852 err = c.Cli.CallCompressed(ctx, "keybase.1.metadata.getLatestFolderHandle", []interface{}{__arg}, &res, rpc.CompressionGzip, 0*time.Millisecond) 853 return 854 } 855 856 func (c MetadataClient) GetKeyBundles(ctx context.Context, __arg GetKeyBundlesArg) (res KeyBundleResponse, err error) { 857 err = c.Cli.CallCompressed(ctx, "keybase.1.metadata.getKeyBundles", []interface{}{__arg}, &res, rpc.CompressionGzip, 0*time.Millisecond) 858 return 859 } 860 861 func (c MetadataClient) Lock(ctx context.Context, __arg LockArg) (err error) { 862 err = c.Cli.CallCompressed(ctx, "keybase.1.metadata.lock", []interface{}{__arg}, nil, rpc.CompressionGzip, 0*time.Millisecond) 863 return 864 } 865 866 func (c MetadataClient) ReleaseLock(ctx context.Context, __arg ReleaseLockArg) (err error) { 867 err = c.Cli.CallCompressed(ctx, "keybase.1.metadata.releaseLock", []interface{}{__arg}, nil, rpc.CompressionGzip, 0*time.Millisecond) 868 return 869 } 870 871 func (c MetadataClient) StartImplicitTeamMigration(ctx context.Context, folderID string) (err error) { 872 __arg := StartImplicitTeamMigrationArg{FolderID: folderID} 873 err = c.Cli.CallCompressed(ctx, "keybase.1.metadata.startImplicitTeamMigration", []interface{}{__arg}, nil, rpc.CompressionGzip, 0*time.Millisecond) 874 return 875 } 876 877 func (c MetadataClient) GetMerkleRoot(ctx context.Context, __arg GetMerkleRootArg) (res MerkleRoot, err error) { 878 err = c.Cli.CallCompressed(ctx, "keybase.1.metadata.getMerkleRoot", []interface{}{__arg}, &res, rpc.CompressionGzip, 0*time.Millisecond) 879 return 880 } 881 882 func (c MetadataClient) GetMerkleRootLatest(ctx context.Context, treeID MerkleTreeID) (res MerkleRoot, err error) { 883 __arg := GetMerkleRootLatestArg{TreeID: treeID} 884 err = c.Cli.CallCompressed(ctx, "keybase.1.metadata.getMerkleRootLatest", []interface{}{__arg}, &res, rpc.CompressionGzip, 0*time.Millisecond) 885 return 886 } 887 888 func (c MetadataClient) GetMerkleRootSince(ctx context.Context, __arg GetMerkleRootSinceArg) (res MerkleRoot, err error) { 889 err = c.Cli.CallCompressed(ctx, "keybase.1.metadata.getMerkleRootSince", []interface{}{__arg}, &res, rpc.CompressionGzip, 0*time.Millisecond) 890 return 891 } 892 893 func (c MetadataClient) GetMerkleNode(ctx context.Context, hash string) (res []byte, err error) { 894 __arg := GetMerkleNodeArg{Hash: hash} 895 err = c.Cli.CallCompressed(ctx, "keybase.1.metadata.getMerkleNode", []interface{}{__arg}, &res, rpc.CompressionGzip, 0*time.Millisecond) 896 return 897 } 898 899 func (c MetadataClient) FindNextMD(ctx context.Context, __arg FindNextMDArg) (res FindNextMDResponse, err error) { 900 err = c.Cli.CallCompressed(ctx, "keybase.1.metadata.findNextMD", []interface{}{__arg}, &res, rpc.CompressionGzip, 0*time.Millisecond) 901 return 902 } 903 904 func (c MetadataClient) SetImplicitTeamModeForTest(ctx context.Context, implicitTeamMode string) (err error) { 905 __arg := SetImplicitTeamModeForTestArg{ImplicitTeamMode: implicitTeamMode} 906 err = c.Cli.CallCompressed(ctx, "keybase.1.metadata.setImplicitTeamModeForTest", []interface{}{__arg}, nil, rpc.CompressionGzip, 0*time.Millisecond) 907 return 908 } 909 910 func (c MetadataClient) ForceMerkleBuildForTest(ctx context.Context) (err error) { 911 err = c.Cli.CallCompressed(ctx, "keybase.1.metadata.forceMerkleBuildForTest", []interface{}{ForceMerkleBuildForTestArg{}}, nil, rpc.CompressionGzip, 0*time.Millisecond) 912 return 913 }