reflection

package
v0.0.0-...-902f86d Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RPCReflection

type RPCReflection interface {
	// SetUserAgent sets the User-Agent header to be sent in each request.
	SetUserAgent(userAgent string)
	// SetConnectTimeout sets the timeout for dialing a target.
	SetConnectTimeout(timeout time.Duration)
	// SetKeepaliveTime sets the keepalive time for grpc connection.
	SetKeepaliveTime(timeout time.Duration)
	// SetAdditionalHeaders sets the additional headers to be sent in both reflection request and rpc request.
	SetAdditionalHeaders(headers map[string]string)
	// SetReflectionHeaders sets the additional headers to be sent in only reflection request.
	SetReflectionHeaders(headers map[string]string)
	// SetRPCHeaders sets the additional headers to be sent in only rpc request.
	SetRPCHeaders(headers map[string]string)
	// Dail to the target, you should call this method before send reflection request and rpc request
	Dail(ctx context.Context) error
	// Close the connection.
	Close()
	// ListServices returns all services in the target.
	ListServices() ([]string, error)
	// ListMethods returns all methods in the service.
	ListMethods(service string) ([]string, error)
	// Invoke invokes the method with input.
	Invoke(ctx context.Context, methodName, input string) (response string, err error)
	// TemplateString returns the template string of the message.
	TemplateString(messageName string) (string, error)
	// DescribeString returns the description string of the message.
	DescribeString(symbol string) (string, error)
	// Descriptor returns the desc.Descriptor.
	Descriptor(symbol string) (desc.Descriptor, error)
	// InputAndOutputType returns the input and output type of the method.
	InputAndOutputType(methodName string) (string, string, error)
}

func NewRPCReflection

func NewRPCReflection(target string) RPCReflection

Jump to

Keyboard shortcuts

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