/
githubmirror
/
client
Обзор
Документация
Войти
/
githubmirror
/
client
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
go/protocol/gregor1/outgoing.go
52 строки
1 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/gregor1/outgoing.avdl package gregor1 import ( "context" "time" "github.com/keybase/go-framed-msgpack-rpc/rpc" ) type BroadcastMessageArg struct { M Message `codec:"m" json:"m"` } type OutgoingInterface interface { BroadcastMessage(context.Context, Message) error } func OutgoingProtocol(i OutgoingInterface) rpc.Protocol { return rpc.Protocol{ Name: "gregor.1.outgoing", Methods: map[string]rpc.ServeHandlerDescription{ "broadcastMessage": { MakeArg: func() any { var ret [1]BroadcastMessageArg return &ret }, Handler: func(ctx context.Context, args any) (ret any, err error) { typedArgs, ok := args.(*[1]BroadcastMessageArg) if !ok { err = rpc.NewTypeError((*[1]BroadcastMessageArg)(nil), args) return } err = i.BroadcastMessage(ctx, typedArgs[0].M) return }, }, }, } } type OutgoingClient struct { Cli rpc.GenericClient } func (c OutgoingClient) BroadcastMessage(ctx context.Context, m Message) (err error) { __arg := BroadcastMessageArg{M: m} err = c.Cli.CallCompressed(ctx, "gregor.1.outgoing.broadcastMessage", []any{__arg}, nil, rpc.CompressionGzip, 0*time.Millisecond) return }