etcd

package
v1.1.4 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Preset

func Preset(opts ...Option) gnomock.Preset

Types

type Option

type Option func(*P)

func WithAutoSyncInterval

func WithAutoSyncInterval(autoSyncInterval time.Duration) Option

WithAutoSyncInterval is the interval to update endpoints with its latest members. 0 disables auto-sync. By default auto-sync is disabled.

func WithDialKeepAliveTime

func WithDialKeepAliveTime(dialKeepAliveTime time.Duration) Option

WithDialKeepAliveTime is the time after which client pings the server to see if transport is alive.

func WithDialKeepAliveTimeout

func WithDialKeepAliveTimeout(dialKeepAliveTimeout time.Duration) Option

WithDialKeepAliveTimeout is the time that the client waits for a response for the keep-alive probe. If the response is not received in this time, the connection is closed.

func WithDialOptions

func WithDialOptions(dialOptions []grpc.DialOption) Option

WithDialOptions is a list of dial options for the grpc client (e.g., for interceptors). For example, pass "grpc.WithBlock()" to block until the underlying connection is up. Without this, Dial returns immediately and connecting the server happens in background.

func WithDialTimeout

func WithDialTimeout(dialTimeout time.Duration) Option

WithDialTimeout is the timeout for failing to establish a connection.

func WithLogConfig

func WithLogConfig(logConfig *zap.Config) Option

WithLogConfig configures client-side logger. If nil, use the default logger. TODO: configure gRPC logger

func WithVersion

func WithVersion(version string) Option

WithVersion sets image version.

type P

type P struct {
	// AutoSyncInterval is the interval to update endpoints with its latest members.
	// 0 disables auto-sync. By default auto-sync is disabled.
	AutoSyncInterval time.Duration `json:"auto-sync-interval"`
	// DialTimeout is the timeout for failing to establish a connection.
	DialTimeout time.Duration `json:"dial-timeout"`

	// DialKeepAliveTime is the time after which client pings the server to see if
	// transport is alive.
	DialKeepAliveTime time.Duration `json:"dial-keep-alive-time"`

	// DialKeepAliveTimeout is the time that the client waits for a response for the
	// keep-alive probe. If the response is not received in this time, the connection is closed.
	DialKeepAliveTimeout time.Duration `json:"dial-keep-alive-timeout"`
	// Username is a user name for authentication.
	Username string `json:"username"`

	// Password is a password for authentication.
	Password string `json:"password"`
	// DialOptions is a list of dial options for the grpc client (e.g., for interceptors).
	// For example, pass "grpc.WithBlock()" to block until the underlying connection is up.
	// Without this, Dial returns immediately and connecting the server happens in background.
	DialOptions []grpc.DialOption
	// LogConfig configures client-side logger.
	// If nil, use the default logger.
	// TODO: configure gRPC logger
	LogConfig *zap.Config

	Version string `json:"version"`
}

func (*P) Image

func (p *P) Image() string

Image returns an image that should be pulled to create this container.

func (*P) Options

func (p *P) Options() []gnomock.Option

Options returns a list of options to configure this container.

func (*P) Ports

func (p *P) Ports() gnomock.NamedPorts

Ports returns ports that should be used to access this container.

Jump to

Keyboard shortcuts

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