Documentation ¶
Overview ¶
Package options defines options that can be customized when creating a Peer.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Option ¶
type Option func(v visitor) error
Option is a function that applies a configuration change.
func CommandWorkers ¶
CommandWorkers returns an Option that specifies the number of incoming command REQUESTS that are accepted at any given time. A new goroutine is started to service each command request.
func DefaultTimeout ¶
DefaultTimeout returns an Option that specifies the maximum amount of time to wait for a call to return. It is used if the context passed to Session.Call() does not already have a deadline.
func FromEnv ¶
FromEnv returns peer options with values read from environment variables.
The environment variables are listed below.
- RINQ_DEFAULT_TIMEOUT (duration in milliseconds, non-zero) - RINQ_LOG_DEBUG (boolean 'true' or 'false') - RINQ_COMMAND_WORKERS (positive integer, non-zero) - RINQ_SESSION_WORKERS (positive integer, non-zero) - RINQ_PRUNE_INTERVAL (duration in milliseconds, non-zero) - RINQ_PRODUCT (string)
func Product ¶
Product returns an Option that specifies an application-defined string that identifies the application.
It is recommended that the product take the form "<product>/<version>" such as "my-app/1.3.0".
func PruneInterval ¶
PruneInterval returns an Option that specifies how often the cache of remote session information is purged of unused data.
func SessionWorkers ¶
SessionWorkers returns an Option that specifies the number of command RESPONSES or notifications that are buffered in memory at any given time.
func Tracer ¶
func Tracer(t opentracing.Tracer) Option
Tracer returns an Option that specifies an OpenTracing tracer to use for tracking Rinq operations.
See http://opentracing.io for more information.
type Options ¶
type Options struct { DefaultTimeout time.Duration Logger twelf.Logger CommandWorkers uint SessionWorkers uint PruneInterval time.Duration Product string Tracer opentracing.Tracer }
Options is a structure representing a resolved set of options.
func NewOptions ¶
NewOptions returns a new Options object from the given options, with default values for any options that are not specified.