/
githubmirror
/
client
Обзор
Документация
Войти
/
githubmirror
/
client
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
go/protocol/keybase1/kbfs_git.go
131 строка
4 KB
chrisnojima-zoom
Version 670 - clean2 (#29122)
08 июн 2026, 19:31
Не верифицирован
08 июн 2026, 19:31
1943197
Код
Авторство
О чём код?
// Code generated to Go types and interfaces using avdl-compiler v1.4.10 (https://github.com/keybase/node-avdl-compiler). DO NOT EDIT. // Input file: avdl/keybase1/kbfs_git.avdl package keybase1 import ( "context" "time" "github.com/keybase/go-framed-msgpack-rpc/rpc" ) type GcOptions struct { MaxLooseRefs int `codec:"maxLooseRefs" json:"maxLooseRefs"` PruneMinLooseObjects int `codec:"pruneMinLooseObjects" json:"pruneMinLooseObjects"` PruneExpireTime Time `codec:"pruneExpireTime" json:"pruneExpireTime"` MaxObjectPacks int `codec:"maxObjectPacks" json:"maxObjectPacks"` } func (o GcOptions) DeepCopy() GcOptions { return GcOptions{ MaxLooseRefs: o.MaxLooseRefs, PruneMinLooseObjects: o.PruneMinLooseObjects, PruneExpireTime: o.PruneExpireTime.DeepCopy(), MaxObjectPacks: o.MaxObjectPacks, } } type CreateRepoArg struct { Folder FolderHandle `codec:"folder" json:"folder"` Name GitRepoName `codec:"name" json:"name"` } type DeleteRepoArg struct { Folder FolderHandle `codec:"folder" json:"folder"` Name GitRepoName `codec:"name" json:"name"` } type GcArg struct { Folder FolderHandle `codec:"folder" json:"folder"` Name GitRepoName `codec:"name" json:"name"` Options GcOptions `codec:"options" json:"options"` } type KBFSGitInterface interface { // * createRepo creates a bare empty repo on KBFS under the given name in the given TLF. // * It returns the ID of the repo created. CreateRepo(context.Context, CreateRepoArg) (RepoID, error) // * deleteRepo deletes repo on KBFS under the given name in the given TLF. DeleteRepo(context.Context, DeleteRepoArg) error // * gc runs garbage collection on the given repo, using the given options to // * see whether anything needs to be done. Gc(context.Context, GcArg) error } func KBFSGitProtocol(i KBFSGitInterface) rpc.Protocol { return rpc.Protocol{ Name: "keybase.1.KBFSGit", Methods: map[string]rpc.ServeHandlerDescription{ "createRepo": { MakeArg: func() any { var ret [1]CreateRepoArg return &ret }, Handler: func(ctx context.Context, args any) (ret any, err error) { typedArgs, ok := args.(*[1]CreateRepoArg) if !ok { err = rpc.NewTypeError((*[1]CreateRepoArg)(nil), args) return } ret, err = i.CreateRepo(ctx, typedArgs[0]) return }, }, "deleteRepo": { MakeArg: func() any { var ret [1]DeleteRepoArg return &ret }, Handler: func(ctx context.Context, args any) (ret any, err error) { typedArgs, ok := args.(*[1]DeleteRepoArg) if !ok { err = rpc.NewTypeError((*[1]DeleteRepoArg)(nil), args) return } err = i.DeleteRepo(ctx, typedArgs[0]) return }, }, "gc": { MakeArg: func() any { var ret [1]GcArg return &ret }, Handler: func(ctx context.Context, args any) (ret any, err error) { typedArgs, ok := args.(*[1]GcArg) if !ok { err = rpc.NewTypeError((*[1]GcArg)(nil), args) return } err = i.Gc(ctx, typedArgs[0]) return }, }, }, } } type KBFSGitClient struct { Cli rpc.GenericClient } // * createRepo creates a bare empty repo on KBFS under the given name in the given TLF. // * It returns the ID of the repo created. func (c KBFSGitClient) CreateRepo(ctx context.Context, __arg CreateRepoArg) (res RepoID, err error) { err = c.Cli.Call(ctx, "keybase.1.KBFSGit.createRepo", []any{__arg}, &res, 0*time.Millisecond) return } // * deleteRepo deletes repo on KBFS under the given name in the given TLF. func (c KBFSGitClient) DeleteRepo(ctx context.Context, __arg DeleteRepoArg) (err error) { err = c.Cli.Call(ctx, "keybase.1.KBFSGit.deleteRepo", []any{__arg}, nil, 0*time.Millisecond) return } // * gc runs garbage collection on the given repo, using the given options to // * see whether anything needs to be done. func (c KBFSGitClient) Gc(ctx context.Context, __arg GcArg) (err error) { err = c.Cli.Call(ctx, "keybase.1.KBFSGit.gc", []any{__arg}, nil, 0*time.Millisecond) return }