result

package
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 18, 2019 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package result contains the results from various operations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BuildInfo

type BuildInfo struct {
	OK           bool    `bson:"ok"`
	GitVersion   string  `bson:"gitVersion,omitempty"`
	Version      string  `bson:"version,omitempty"`
	VersionArray []uint8 `bson:"versionArray,omitempty"`
}

BuildInfo is a result of a BuildInfo command.

func (BuildInfo) IsZero

func (bi BuildInfo) IsZero() bool

IsZero returns true if the BuildInfo is the zero value.

type BulkWrite

type BulkWrite struct {
	InsertedCount int64
	MatchedCount  int64
	ModifiedCount int64
	DeletedCount  int64
	UpsertedCount int64
	UpsertedIDs   map[int64]interface{}
}

BulkWrite holds the result of a bulk write operation.

type CreateIndexes

type CreateIndexes struct {
	CreatedCollectionAutomatically bool `bson:"createdCollectionAutomatically"`
	IndexesBefore                  int  `bson:"numIndexesBefore"`
	IndexesAfter                   int  `bson:"numIndexesAfter"`
}

CreateIndexes is a result of a CreateIndexes command.

type Delete

type Delete struct {
	N                 int
	WriteErrors       []WriteError       `bson:"writeErrors"`
	WriteConcernError *WriteConcernError `bson:"writeConcernError"`
}

Delete is a result from a Delete command.

type Distinct

type Distinct struct {
	Values []interface{}
}

Distinct is a result from a Distinct command.

type EndSessions

type EndSessions struct{}

EndSessions is a result from an EndSessions command.

type FindAndModify

type FindAndModify struct {
	Value           bson.Raw
	LastErrorObject struct {
		UpdatedExisting bool
		Upserted        interface{}
	}
	WriteConcernError *WriteConcernError `bson:"writeConcernError"`
}

FindAndModify is a result from a findAndModify command.

type GetLastError

type GetLastError struct {
	ConnectionID uint32 `bson:"connectionId"`
}

GetLastError is a result of a GetLastError command.

type Insert

type Insert struct {
	N                 int
	WriteErrors       []WriteError       `bson:"writeErrors"`
	WriteConcernError *WriteConcernError `bson:"writeConcernError"`
}

Insert is a result from an Insert command.

type IsMaster

type IsMaster struct {
	Arbiters                     []string           `bson:"arbiters,omitempty"`
	ArbiterOnly                  bool               `bson:"arbiterOnly,omitempty"`
	ClusterTime                  bson.Raw           `bson:"$clusterTime,omitempty"`
	Compression                  []string           `bson:"compression,omitempty"`
	ElectionID                   primitive.ObjectID `bson:"electionId,omitempty"`
	Hidden                       bool               `bson:"hidden,omitempty"`
	Hosts                        []string           `bson:"hosts,omitempty"`
	IsMaster                     bool               `bson:"ismaster,omitempty"`
	IsReplicaSet                 bool               `bson:"isreplicaset,omitempty"`
	LastWriteTimestamp           time.Time          `bson:"lastWriteDate,omitempty"`
	LogicalSessionTimeoutMinutes uint32             `bson:"logicalSessionTimeoutMinutes,omitempty"`
	MaxBSONObjectSize            uint32             `bson:"maxBsonObjectSize,omitempty"`
	MaxMessageSizeBytes          uint32             `bson:"maxMessageSizeBytes,omitempty"`
	MaxWriteBatchSize            uint32             `bson:"maxWriteBatchSize,omitempty"`
	Me                           string             `bson:"me,omitempty"`
	MaxWireVersion               int32              `bson:"maxWireVersion,omitempty"`
	MinWireVersion               int32              `bson:"minWireVersion,omitempty"`
	Msg                          string             `bson:"msg,omitempty"`
	OK                           int32              `bson:"ok"`
	Passives                     []string           `bson:"passives,omitempty"`
	ReadOnly                     bool               `bson:"readOnly,omitempty"`
	SaslSupportedMechs           []string           `bson:"saslSupportedMechs,omitempty"`
	Secondary                    bool               `bson:"secondary,omitempty"`
	SetName                      string             `bson:"setName,omitempty"`
	SetVersion                   uint32             `bson:"setVersion,omitempty"`
	Tags                         map[string]string  `bson:"tags,omitempty"`
}

IsMaster is a result of an IsMaster command.

type KillCursors

type KillCursors struct {
	CursorsKilled   []int64 `bson:"cursorsKilled"`
	CursorsNotFound []int64 `bson:"cursorsNotFound"`
	CursorsAlive    []int64 `bson:"cursorsAlive"`
}

KillCursors is a result of a KillCursors command.

type ListDatabases

type ListDatabases struct {
	Databases []struct {
		Name       string
		SizeOnDisk int64 `bson:"sizeOnDisk"`
		Empty      bool
	}
	TotalSize int64 `bson:"totalSize"`
}

ListDatabases is the result from a listDatabases command.

type StartSession

type StartSession struct {
	ID bsonx.Doc `bson:"id"`
}

StartSession is a result from a StartSession command.

type TransactionResult

type TransactionResult struct {
	WriteConcernError *WriteConcernError `bson:"writeConcernError"`
}

TransactionResult holds the result of committing or aborting a transaction.

type Update

type Update struct {
	MatchedCount      int64              `bson:"n"`
	ModifiedCount     int64              `bson:"nModified"`
	Upserted          []Upsert           `bson:"upserted"`
	WriteErrors       []WriteError       `bson:"writeErrors"`
	WriteConcernError *WriteConcernError `bson:"writeConcernError"`
}

Update is a result of an Update command.

type Upsert

type Upsert struct {
	Index int64       `bson:"index"`
	ID    interface{} `bson:"_id"`
}

Upsert contains the information for a single upsert.

type WriteConcernError

type WriteConcernError struct {
	Code    int
	ErrMsg  string
	ErrInfo bson.Raw
}

WriteConcernError is an error related to a write concern.

func (WriteConcernError) Error added in v1.0.0

func (wce WriteConcernError) Error() string

type WriteError

type WriteError struct {
	Index  int
	Code   int
	ErrMsg string
}

WriteError is an error from a write operation that is not a write concern error.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL