/
githubmirror
/
client
Обзор
Документация
Войти
/
githubmirror
/
client
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
go/protocol/keybase1/gregor.go
180 строк
5 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/gregor.avdl package keybase1 import ( "context" "time" gregor1 "github.com/keybase/client/go/protocol/gregor1" "github.com/keybase/go-framed-msgpack-rpc/rpc" ) type GetStateArg struct { } type InjectItemArg struct { Cat string `codec:"cat" json:"cat"` Body string `codec:"body" json:"body"` Dtime gregor1.TimeOrOffset `codec:"dtime" json:"dtime"` } type DismissCategoryArg struct { Category gregor1.Category `codec:"category" json:"category"` } type DismissItemArg struct { Id gregor1.MsgID `codec:"id" json:"id"` } type UpdateItemArg struct { MsgID gregor1.MsgID `codec:"msgID" json:"msgID"` Cat string `codec:"cat" json:"cat"` Body string `codec:"body" json:"body"` Dtime gregor1.TimeOrOffset `codec:"dtime" json:"dtime"` } type UpdateCategoryArg struct { Category string `codec:"category" json:"category"` Body string `codec:"body" json:"body"` Dtime gregor1.TimeOrOffset `codec:"dtime" json:"dtime"` } type GregorInterface interface { GetState(context.Context) (gregor1.State, error) InjectItem(context.Context, InjectItemArg) (gregor1.MsgID, error) DismissCategory(context.Context, gregor1.Category) error DismissItem(context.Context, gregor1.MsgID) error UpdateItem(context.Context, UpdateItemArg) (gregor1.MsgID, error) UpdateCategory(context.Context, UpdateCategoryArg) (gregor1.MsgID, error) } func GregorProtocol(i GregorInterface) rpc.Protocol { return rpc.Protocol{ Name: "keybase.1.gregor", Methods: map[string]rpc.ServeHandlerDescription{ "getState": { MakeArg: func() any { var ret [1]GetStateArg return &ret }, Handler: func(ctx context.Context, args any) (ret any, err error) { ret, err = i.GetState(ctx) return }, }, "injectItem": { MakeArg: func() any { var ret [1]InjectItemArg return &ret }, Handler: func(ctx context.Context, args any) (ret any, err error) { typedArgs, ok := args.(*[1]InjectItemArg) if !ok { err = rpc.NewTypeError((*[1]InjectItemArg)(nil), args) return } ret, err = i.InjectItem(ctx, typedArgs[0]) return }, }, "dismissCategory": { MakeArg: func() any { var ret [1]DismissCategoryArg return &ret }, Handler: func(ctx context.Context, args any) (ret any, err error) { typedArgs, ok := args.(*[1]DismissCategoryArg) if !ok { err = rpc.NewTypeError((*[1]DismissCategoryArg)(nil), args) return } err = i.DismissCategory(ctx, typedArgs[0].Category) return }, }, "dismissItem": { MakeArg: func() any { var ret [1]DismissItemArg return &ret }, Handler: func(ctx context.Context, args any) (ret any, err error) { typedArgs, ok := args.(*[1]DismissItemArg) if !ok { err = rpc.NewTypeError((*[1]DismissItemArg)(nil), args) return } err = i.DismissItem(ctx, typedArgs[0].Id) return }, }, "updateItem": { MakeArg: func() any { var ret [1]UpdateItemArg return &ret }, Handler: func(ctx context.Context, args any) (ret any, err error) { typedArgs, ok := args.(*[1]UpdateItemArg) if !ok { err = rpc.NewTypeError((*[1]UpdateItemArg)(nil), args) return } ret, err = i.UpdateItem(ctx, typedArgs[0]) return }, }, "updateCategory": { MakeArg: func() any { var ret [1]UpdateCategoryArg return &ret }, Handler: func(ctx context.Context, args any) (ret any, err error) { typedArgs, ok := args.(*[1]UpdateCategoryArg) if !ok { err = rpc.NewTypeError((*[1]UpdateCategoryArg)(nil), args) return } ret, err = i.UpdateCategory(ctx, typedArgs[0]) return }, }, }, } } type GregorClient struct { Cli rpc.GenericClient } func (c GregorClient) GetState(ctx context.Context) (res gregor1.State, err error) { err = c.Cli.Call(ctx, "keybase.1.gregor.getState", []any{GetStateArg{}}, &res, 0*time.Millisecond) return } func (c GregorClient) InjectItem(ctx context.Context, __arg InjectItemArg) (res gregor1.MsgID, err error) { err = c.Cli.Call(ctx, "keybase.1.gregor.injectItem", []any{__arg}, &res, 0*time.Millisecond) return } func (c GregorClient) DismissCategory(ctx context.Context, category gregor1.Category) (err error) { __arg := DismissCategoryArg{Category: category} err = c.Cli.Call(ctx, "keybase.1.gregor.dismissCategory", []any{__arg}, nil, 0*time.Millisecond) return } func (c GregorClient) DismissItem(ctx context.Context, id gregor1.MsgID) (err error) { __arg := DismissItemArg{Id: id} err = c.Cli.Call(ctx, "keybase.1.gregor.dismissItem", []any{__arg}, nil, 0*time.Millisecond) return } func (c GregorClient) UpdateItem(ctx context.Context, __arg UpdateItemArg) (res gregor1.MsgID, err error) { err = c.Cli.Call(ctx, "keybase.1.gregor.updateItem", []any{__arg}, &res, 0*time.Millisecond) return } func (c GregorClient) UpdateCategory(ctx context.Context, __arg UpdateCategoryArg) (res gregor1.MsgID, err error) { err = c.Cli.Call(ctx, "keybase.1.gregor.updateCategory", []any{__arg}, &res, 0*time.Millisecond) return }