lazy

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 18, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(cc *grpc.ClientConn) *Client

func (*Client) InvokeStream

func (lc *Client) InvokeStream(ctx context.Context, desc *MethodDesc, in *Message, copts ...grpc.CallOption) (*Stream, error)

func (*Client) InvokeUnary

func (lc *Client) InvokeUnary(ctx context.Context, desc *MethodDesc, in *Message, copts ...grpc.CallOption) (out *Message, err error)

type Codec

type Codec struct{}

Codec is basically a no-op grpc.Codec use to pass LazyMessage through grpc

func NewCodec

func NewCodec() *Codec

func (*Codec) Marshal

func (lc *Codec) Marshal(value interface{}) ([]byte, error)

func (*Codec) Name

func (lc *Codec) Name() string

func (*Codec) String

func (lc *Codec) String() string

func (*Codec) Unmarshal

func (*Codec) Unmarshal(buf []byte, value interface{}) error

type LazyMessageReflect

type LazyMessageReflect *Message

type Message

type Message struct {
	// contains filtered or unexported fields
}

Message is basically a no-op `proto.Message` used to pass serialized message through grpc

func NewMessage

func NewMessage() *Message

func (*Message) Base64

func (m *Message) Base64() string

func (*Message) Bytes

func (m *Message) Bytes() []byte

func (*Message) FromBase64

func (m *Message) FromBase64(b64 string) (lm *Message, err error)

func (*Message) FromBytes

func (m *Message) FromBytes(buf []byte) *Message

func (*Message) FromMessage

func (m *Message) FromMessage(msg proto.Message) (*Message, error)

func (*Message) ProtoMessage

func (m *Message) ProtoMessage()

func (*Message) ProtoReflect

func (m *Message) ProtoReflect() protoreflect.Message

ProtoReflect is not usefull with LazyMessage

func (*Message) Reset

func (m *Message) Reset()

func (*Message) String

func (m *Message) String() string

type MethodDesc

type MethodDesc struct {
	Name          string
	ClientStreams bool
	ServerStreams bool
}

type Stream

type Stream struct {
	// used to close the stream
	context.CancelFunc
	grpc.ClientStream
	// contains filtered or unexported fields
}

func (*Stream) Close

func (s *Stream) Close() (err error)

func (*Stream) ID

func (s *Stream) ID() uint64

func (*Stream) RecvMsg

func (s *Stream) RecvMsg(out proto.Message) (err error)

func (*Stream) SendMsg

func (s *Stream) SendMsg(in proto.Message) (err error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL