grpc

package
v0.28.0 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NativeClient added in v0.28.0

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

NativeClient provides gRPC operations using native Go libraries, eliminating the need for the grpcurl binary for one-shot commands.

func NewNativeClient added in v0.28.0

func NewNativeClient(addr, protoDir string, reflection bool) *NativeClient

NewNativeClient creates a native gRPC client.

func (*NativeClient) Call added in v0.28.0

func (n *NativeClient) Call(_, _ string) (string, error)

Call invokes a gRPC method using server reflection to discover the schema. For simple JSON-in/JSON-out calls, this uses raw grpcurl encoding. Falls back to grpcurl CLI for methods requiring complex proto serialization.

func (*NativeClient) Describe added in v0.28.0

func (n *NativeClient) Describe(service string) (string, error)

Describe returns the file descriptor for a service using server reflection.

func (*NativeClient) ListServices added in v0.28.0

func (n *NativeClient) ListServices() (string, error)

ListServices lists all gRPC services using server reflection.

type Session

type Session struct {
	Addr       string
	ProtoDir   string
	Reflection bool
}

func NewSession

func NewSession(cfg *config.GRPC) (*Session, error)

func (*Session) Call

func (s *Session) Call(method, data string) (string, error)

Call invokes a gRPC method. Uses native client first, then CLI fallback.

func (*Session) Describe

func (s *Session) Describe(service string) (string, error)

Describe describes a gRPC service. Uses native client first, then CLI fallback.

func (*Session) Interactive

func (s *Session) Interactive() error

Interactive opens an interactive gRPC REPL session. Uses evans if available, otherwise falls back to grpcurl.

func (*Session) ListServices

func (s *Session) ListServices() (string, error)

ListServices lists all gRPC services. Uses native Go gRPC client first (no external binary needed when server reflection is enabled), then falls back to the grpcurl CLI.

Jump to

Keyboard shortcuts

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