Documentation ¶
Overview ¶
Package dial provides the actual dialing features used by the untilMongod command.
It might conceivably be imported on its own for other use case, since it does not have any dependency on the command itself.
• dial.go contains its dialing-related parts
• time.go file contains its time-related parts
Index ¶
Constants ¶
const BackoffFactor = 1.5
BackoffFactor is the interval increase coefficient for retries.
const DefaultURL = "mongodb://localhost:27017"
DefaultURL is the default MongoDB server URL.
const ExpectedErrorString = "no reachable servers"
ExpectedErrorString is used by MongoDB clients to signal it could not connect, starting with the mongo shell.
const MaxDuration time.Duration = 1<<63 - 1
MaxDuration is the largest Duration the time.Duration type can represent.
Cannot use time.maxDuration since it is private in time package.
Variables ¶
This section is empty.
Functions ¶
func IsMaxTimeoutValid ¶
IsMaxTimeoutValid ensures timeouts passed to dialers are positive and not too large.
Types ¶
type DriverDial ¶
DriverDial is the type of the lower-level functions actually implementing the "connect to a server" feature, without the backoff mechanism.
Its implementations are typically thin wrappers around a driver-provided mechanism.
func NewMongoDbDial ¶
func NewMongoDbDial() DriverDial
NewMongoDbDial returns a new DriverDial function using the official MongoDB driver available at https://github.com/mongodb/mongo-go-driver
type Reporter ¶
type Reporter struct {
// contains filtered or unexported fields
}
Reporter prints to a writer, defaulting to stderr, only if verbose is true.
func NewReporter ¶
NewReporter creates an instance of Reporter.
The final variadic io.Writer argument allows passing ONE specific writer, and defaulting to os.Stderr when none is passed.