grpc

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2023 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GRPCEventTypeUnknown gRPCEventType = iota
	MethodResolved       gRPCEventType = iota
	HeadersSent          gRPCEventType = iota
	HeadersReceived      gRPCEventType = iota
	ResponseReceived     gRPCEventType = iota
	ReceivedTrailers     gRPCEventType = iota
	EventError           gRPCEventType = iota
)

Variables

View Source
var (
	ProtoJSONMarshaler = &jsonpb.Marshaler{
		EmitDefaults: true,
		Indent:       "  ",
	}
)

Functions

This section is empty.

Types

type Event

type Event struct {
	Type    gRPCEventType
	Payload interface{}
	Err     error
}

type InDesc

type InDesc struct {
	Desc    string
	Example string
	Err     error
}

type MessageWrapper

type MessageWrapper struct {
	Msg protoreflect.Message
}

func (MessageWrapper) ProtoReflect

func (mw MessageWrapper) ProtoReflect() protoreflect.Message

type Opts

type Opts struct {
	ConnectTimeout time.Duration
	KeepaliveTime  time.Duration
	MaxMsgSize     int
	Insecure       bool
}

func DefaultOpts

func DefaultOpts() Opts

type TypeAndError

type TypeAndError[T any] struct {
	Result T
	Err    error
}

type Wrapper

type Wrapper struct {
	Target string
	// contains filtered or unexported fields
}

func New

func New(ctx context.Context, target string, connOpts Opts) (*Wrapper, error)

func (*Wrapper) CancelInvoke added in v0.0.3

func (g *Wrapper) CancelInvoke()

func (*Wrapper) Close

func (g *Wrapper) Close()

func (*Wrapper) GetInputDescription

func (g *Wrapper) GetInputDescription(method string) <-chan InDesc

func (*Wrapper) Invoke

func (g *Wrapper) Invoke(method string, request string) (<-chan Event, error)

func (*Wrapper) ListMethods

func (g *Wrapper) ListMethods(service string) <-chan TypeAndError[[]string]

func (*Wrapper) ListServices

func (g *Wrapper) ListServices() <-chan TypeAndError[[]string]

Jump to

Keyboard shortcuts

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