import "berty.tech/berty/go/internal/grpcutil"
Package grpcutil contains gRPC lazy codecs, messages and a buf-based listener.
buf_listener.go doc.go lazy_client.go lazy_codec.go lazy_message.go server.go simple_auth.go
const ( P_GRPC = BertyCustomPrefix + 0x0002 //nolint:golint P_GRPC_WEB = BertyCustomPrefix + 0x0004 //nolint:golint P_GRPC_WEBSOCKET = BertyCustomPrefix + 0x0008 //nolint:golint P_GRPC_GATEWAY = BertyCustomPrefix + 0x0016 //nolint:golint )
const BertyCustomPrefix = 0xbe00
BertyCustomPrefix is a multiformat custom prefix
func NewUnsecureSimpleAuthAccess(scheme, token string) credentials.PerRPCCredentials
NewUnsecureSimpleAuthAccess constructs the PerRPCCredentials using a given token.
func NewBufListener(ctx context.Context, sz int) *BufListener
func (bl *BufListener) NewClientConn(opts ...grpc.DialOption) (*grpc.ClientConn, error)
type LazyClient struct {
// contains filtered or unexported fields
}
func NewLazyClient(cc *grpc.ClientConn) *LazyClient
func (lc *LazyClient) InvokeStream(ctx context.Context, desc *LazyMethodDesc, in *LazyMessage, copts ...grpc.CallOption) (*LazyStream, error)
func (lc *LazyClient) InvokeUnary(ctx context.Context, desc *LazyMethodDesc, in *LazyMessage, copts ...grpc.CallOption) (out *LazyMessage, err error)
type LazyCodec struct{}
LazyCodec is basically a no-op grpc.Codec use to pass LazyMessage through grpc
type LazyMessage struct {
// contains filtered or unexported fields
}
LazyMessage is basically a no-op `proto.Message` used to pass serialized message through grpc
func NewLazyMessage() *LazyMessage
func (m *LazyMessage) Base64() string
func (m *LazyMessage) Bytes() []byte
func (m *LazyMessage) FromBase64(b64 string) (lm *LazyMessage, err error)
func (m *LazyMessage) FromBytes(buf []byte) *LazyMessage
func (m *LazyMessage) ProtoMessage()
func (m *LazyMessage) Reset()
func (m *LazyMessage) String() string
type LazyStream struct { // used to close the stream context.CancelFunc grpc.ClientStream // contains filtered or unexported fields }
func (s *LazyStream) Close() (err error)
func (s *LazyStream) ID() uint64
func (s *LazyStream) RecvMsg(out proto.Message) (err error)
func (s *LazyStream) SendMsg(in proto.Message) (err error)
Package grpcutil imports 15 packages (graph). Updated 2021-01-22. Refresh now. Tools for package owners.