package internal
import "go.mongodb.org/mongo-driver/internal"
Index ¶
- Variables
- func MultiError(errors ...error) error
- func RolledUpErrorMessage(err error) string
- func UnwrapError(err error) error
- func WrapError(inner error, message string) error
- func WrapErrorf(inner error, format string, args ...interface{}) error
- type Semaphore
- func NewSemaphore(slots uint64) *Semaphore
- func (s *Semaphore) Len() uint64
- func (s *Semaphore) Release() error
- func (s *Semaphore) Wait(ctx context.Context) error
- type WrappedError
Variables ¶
var Version = "local build"
Version is the current version of the driver.
Functions ¶
func MultiError ¶
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 ¶
RolledUpErrorMessage gets a flattened error message.
func UnwrapError ¶
UnwrapError attempts to unwrap the error down to its root cause.
func WrapError ¶
WrapError wraps an error with a message.
func WrapErrorf ¶
WrapErrorf wraps an error with a message.
Types ¶
type Semaphore ¶
type Semaphore struct {
// contains filtered or unexported fields
}
Semaphore is a synchronization primitive that controls access to a common resource.
func NewSemaphore ¶
NewSemaphore creates a new semaphore.
func (*Semaphore) Len ¶
Len gets the number of permits available.
func (*Semaphore) Release ¶
Release releases a resource back into the pool.
func (*Semaphore) Wait ¶
Wait waits until a resource is available or until the context is done.
type WrappedError ¶
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.
Source Files ¶
const.go error.go semaphore.go
Directories ¶
Path | Synopsis |
---|---|
internal/testutil | |
internal/testutil/assert | |
internal/testutil/helpers | |
internal/testutil/israce | Package israce reports if the Go race detector is enabled. |
- Version
- v1.3.4
- Published
- Jun 3, 2020
- Platform
- linux/amd64
- Imports
- 3 packages
- Last checked
- 45 minutes ago –
Tools for package owners.