mongo-driver: Index | Files | Directories

package internal

import ""


Package Files

const.go error.go semaphore.go


var Version = "local build"

Version is the current version of the driver.

func MultiError Uses

func MultiError(errors ...error) error

MultiError combines multiple errors into a single error. If there are no errors, nil is returned. If there is 1 error, it is returned. Otherwise, they are combined.

func RolledUpErrorMessage Uses

func RolledUpErrorMessage(err error) string

RolledUpErrorMessage gets a flattened error message.

func UnwrapError Uses

func UnwrapError(err error) error

UnwrapError attempts to unwrap the error down to its root cause.

func WrapError Uses

func WrapError(inner error, message string) error

WrapError wraps an error with a message.

func WrapErrorf Uses

func WrapErrorf(inner error, format string, args ...interface{}) error

WrapErrorf wraps an error with a message.

type Semaphore Uses

type Semaphore struct {
    // contains filtered or unexported fields

Semaphore is a synchronization primitive that controls access to a common resource.

func NewSemaphore Uses

func NewSemaphore(slots uint64) *Semaphore

NewSemaphore creates a new semaphore.

func (*Semaphore) Len Uses

func (s *Semaphore) Len() uint64

Len gets the number of permits available.

func (*Semaphore) Release Uses

func (s *Semaphore) Release() error

Release releases a resource back into the pool.

func (*Semaphore) Wait Uses

func (s *Semaphore) Wait(ctx context.Context) error

Wait waits until a resource is available or until the context is done.

type WrappedError Uses

type WrappedError interface {
    // Message gets the basic message of the error.
    Message() string
    // Inner gets the inner error if one exists.
    Inner() error

WrappedError represents an error that contains another error.


testutil/isracePackage israce reports if the Go race detector is enabled.

Package internal imports 3 packages (graph) and is imported by 1 packages. Updated 2019-10-09. Refresh now. Tools for package owners.