grpc

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2024 License: BSD-2-Clause Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClientConfig

type ClientConfig struct {
	RequestTimeout time.Duration `mapstructure:"requestTimeout" validate:"gt=100ms"`
	Config         *Config       `mapstructure:"client" validate:"required"`
}

type ClientInterface

type ClientInterface interface {
	Invoke(ctx context.Context, method string, args interface{}, reply interface{}, opts ...grpc.CallOption) error
	NewStream(ctx context.Context, desc *grpc.StreamDesc, method string, opts ...grpc.CallOption) (grpc.ClientStream, error)
	Close() error
}

func NewClient

func NewClient(c *ClientConfig) (ClientInterface, error)

type Config

type Config struct {
	TargetAddr     string        `mapstructure:"targetAddr" validate:"required"`
	RequestTimeout time.Duration `mapstructure:"requestTimeout" validate:"gt=100ms"`
	TLS            bool          `mapstructure:"tls"`
	TLSSkipVerify  bool          `mapstructure:"tlsSkipverify"`
}

Jump to

Keyboard shortcuts

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