grpc_client

package
v0.2.8 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2023 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,hostname_port" usage:"grpc server address" example:"localhost:9000"`
	UseTls   bool   `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 added in v0.2.8

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