Documentation ¶
Index ¶
- func Preset(opts ...Option) gnomock.Preset
- type Option
- func WithAutoSyncInterval(autoSyncInterval time.Duration) Option
- func WithDialKeepAliveTime(dialKeepAliveTime time.Duration) Option
- func WithDialKeepAliveTimeout(dialKeepAliveTimeout time.Duration) Option
- func WithDialOptions(dialOptions []grpc.DialOption) Option
- func WithDialTimeout(dialTimeout time.Duration) Option
- func WithLogConfig(logConfig *zap.Config) Option
- func WithVersion(version string) Option
- type P
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Option ¶
type Option func(*P)
func WithAutoSyncInterval ¶
WithAutoSyncInterval is the interval to update endpoints with its latest members. 0 disables auto-sync. By default auto-sync is disabled.
func WithDialKeepAliveTime ¶
WithDialKeepAliveTime is the time after which client pings the server to see if transport is alive.
func WithDialKeepAliveTimeout ¶
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 ¶
WithDialTimeout is the timeout for failing to establish a connection.
func WithLogConfig ¶
WithLogConfig configures client-side logger. If nil, use the default logger. TODO: configure gRPC logger
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) Ports ¶
func (p *P) Ports() gnomock.NamedPorts
Ports returns ports that should be used to access this container.