pbclient

package
v0.0.0-...-69c2794 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrFailedToConnect = fmt.Errorf("failed to connect")
	ErrNoConnection    = fmt.Errorf("no connection")
	ErrFailedToClose   = fmt.Errorf("failed to close connection")
)

Functions

This section is empty.

Types

type Conn

type Conn interface {
	Connect() error
	Close() error
	Client() *grpc.ClientConn
}

func NewConn

func NewConn(addr string, opts ...ConnOption) Conn

NewConn は接続のタイムアウトを設定するオプションです。

type ConnOption

type ConnOption func(*connCofnig)

ConnOption は接続のオプションを設定するための関数です。

func WithConnectAttempts

func WithConnectAttempts(attempts int) ConnOption

WithConnectAttempts は接続の試行回数を設定するオプションです。 このオプションを設定しない場合、デフォルト値は 3 回です。

func WithConnectBackoff

func WithConnectBackoff(backoff int) ConnOption

WithConnectBackoff は接続のバックオフを設定するオプションです。 このオプションを設定しない場合、デフォルト値は 3 秒です。 バックオフは秒で指定します。

func WithConnectTimeout

func WithConnectTimeout(timeout int) ConnOption

WithConnectTimeout は接続のタイムアウトを設定するオプションです。 このオプションを設定しない場合、デフォルト値は 10 秒です。 タイムアウトは秒で指定します。

func WithLogger

func WithLogger(l *slog.Logger) ConnOption

WithLogger はロガーを設定するオプションです。

func WithOption

func WithOption(opts ...grpc.DialOption) ConnOption

WithOption は接続のオプションを設定するオプションです。

Jump to

Keyboard shortcuts

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