client

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2026 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrServiceNotFound       = errors.New("service not found")
	ErrMethodNotFound        = errors.New("method not found")
	ErrInvalidRequest        = errors.New("invalid request")
	ErrConnectionFailed      = errors.New("connection failed")
	ErrFetchServerInfoFailed = errors.New("failed to fetch server info")
)

Functions

This section is empty.

Types

type Client

type Client interface {
	Invoke(ctx context.Context, address, serviceName, methodName string, req []byte) ([]byte, error)
	GetServiceInvoker(ctx context.Context, address, serviceName string) (ServiceInvoker, error)
	Close() error
}

func NewClient

func NewClient(opts ...Option) Client

type Option

type Option func(*client)

func WithTimeout

func WithTimeout(timeout time.Duration) Option

type ServiceInvoker

type ServiceInvoker interface {
	Invoke(ctx context.Context, methodName string, req []byte) ([]byte, error)
	IsMethodExists(methodName string) bool
}

Jump to

Keyboard shortcuts

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