/
githubmirror
/
client
Обзор
Документация
Войти
/
githubmirror
/
client
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
go/chat/remoteclient.go
55 строк
1 KB
chrisnojima-zoom
Version 670 - clean2 (#29122)
08 июн 2026, 19:31
Не верифицирован
08 июн 2026, 19:31
1943197
Код
Авторство
О чём код?
package chat import ( "context" "time" "github.com/keybase/client/go/chat/globals" "github.com/keybase/client/go/chat/types" "github.com/keybase/client/go/chat/utils" "github.com/keybase/go-framed-msgpack-rpc/rpc" ) type RemoteClient struct { utils.DebugLabeler cli rpc.GenericClient } func NewRemoteClient(g *globals.Context, cli rpc.GenericClient) *RemoteClient { return &RemoteClient{ DebugLabeler: utils.NewDebugLabeler(g.ExternalG(), "RemoteClient", false), cli: cli, } } func (c *RemoteClient) Call(ctx context.Context, method string, arg any, res any, timeout time.Duration, ) (err error) { defer c.Trace(ctx, &err, "%s", method)() err = c.cli.Call(ctx, method, arg, res, timeout) if err == nil { if rlRes, ok := res.(types.RateLimitedResult); ok { globals.CtxAddRateLimit(ctx, rlRes.GetRateLimit()) } } return err } func (c *RemoteClient) CallCompressed(ctx context.Context, method string, arg any, res any, ctype rpc.CompressionType, timeout time.Duration, ) (err error) { defer c.Trace(ctx, &err, "%s", method)() err = c.cli.CallCompressed(ctx, method, arg, res, ctype, timeout) if err == nil { if rlRes, ok := res.(types.RateLimitedResult); ok { globals.CtxAddRateLimit(ctx, rlRes.GetRateLimit()) } } return err } func (c *RemoteClient) Notify(ctx context.Context, method string, arg any, timeout time.Duration) (err error) { defer c.Trace(ctx, &err, "%s", method)() return c.cli.Notify(ctx, method, arg, timeout) }