grpc_client

package module
v0.0.0-...-0237c7f Latest Latest
Warning

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

Go to latest
Published: May 2, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New[T any](
	config Config,
	logger logger,
	fn func(cc grpc.ClientConnInterface) T,
	opts ...Option,
) (T, error)

Types

type Config

type Config struct {
	// Enabled  bool   `default:"true" usage:"allows to enable grpc client" example:"true"`
	Name     string `default:"grpc-client" validate:"required" example:"backend-grpc-client"`
	Addr     string `validate:"required" usage:"grpc server address" example:"localhost:9000"`
	UseTls   bool   `yaml:"use_tls" default:"false" example:"false"`
	Insecure bool   `default:"false" example:"false"`
	// contains filtered or unexported fields
}

Config provides configuration for grpc cleint.

type Option

type Option func(s *Config)

func WithContext

func WithContext(v context.Context) Option

func WithGrpcOpt

func WithGrpcOpt(opts ...grpc.DialOption) Option

func WithName

func WithName(v string) Option

Jump to

Keyboard shortcuts

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