Documentation ¶
Overview ¶
Package grpcutil contains gRPC lazy codecs, messages and a buf-based listener.
Index ¶
- Constants
- type BufListener
- type LazyCodec
- type 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 Listener
- type Server
Constants ¶
View Source
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 )
View Source
const BertyCustomPrefix = 0xbe00
BertyCustomPrefix is a multiformat custom prefix
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BufListener ¶ added in v2.112.0
func NewBufListener ¶ added in v2.112.0
func NewBufListener(ctx context.Context, sz int) *BufListener
func (*BufListener) NewClientConn ¶ added in v2.112.0
func (bl *BufListener) NewClientConn(opts ...grpc.DialOption) (*grpc.ClientConn, error)
type LazyCodec ¶
type LazyCodec struct{}
LazyCodec is basically a no-op grpc.Codec use to pass LazyMessage through grpc
func NewLazyCodec ¶
func NewLazyCodec() *LazyCodec
type LazyMessage ¶
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 ¶
func NewLazyMessage() *LazyMessage
func (*LazyMessage) Base64 ¶
func (m *LazyMessage) Base64() string
func (*LazyMessage) Bytes ¶
func (m *LazyMessage) Bytes() []byte
func (*LazyMessage) FromBase64 ¶
func (m *LazyMessage) FromBase64(b64 string) (lm *LazyMessage, err error)
func (*LazyMessage) FromBytes ¶
func (m *LazyMessage) FromBytes(buf []byte) *LazyMessage
func (*LazyMessage) ProtoMessage ¶
func (m *LazyMessage) ProtoMessage()
func (*LazyMessage) Reset ¶
func (m *LazyMessage) Reset()
func (*LazyMessage) String ¶
func (m *LazyMessage) String() string
Click to show internal directories.
Click to hide internal directories.