Documentation ¶
Index ¶
- Constants
- func Close(ctx context.Context, session *mgo.Session) error
- func WithLastUpdatedUpdate(updateDoc bson.M) (bson.M, error)
- func WithNamespacedLastUpdatedUpdate(updateDoc bson.M, prefixes []string) (newUpdateDoc bson.M, err error)
- func WithNamespacedUniqueTimestampQuery(queryDoc bson.M, timestamps []bson.MongoTimestamp, prefixes []string) bson.M
- func WithNamespacedUniqueTimestampUpdate(updateDoc bson.M, prefixes []string) (newUpdateDoc bson.M, err error)
- func WithNamespacedUpdates(updateDoc bson.M, prefixes []string) (bson.M, error)
- func WithUniqueTimestampQuery(queryDoc bson.M, timestamp bson.MongoTimestamp) bson.M
- func WithUniqueTimestampUpdate(updateDoc bson.M) (bson.M, error)
- func WithUpdates(updateDoc bson.M) (bson.M, error)
- type Graceful
- type Timestamps
Constants ¶
View Source
const ( LastUpdatedKey = "last_updated" UniqueTimestampKey = "unique_timestamp" )
keep these in sync with Timestamps tags below
Variables ¶
This section is empty.
Functions ¶
func WithLastUpdatedUpdate ¶
WithLastUpdatedUpdate adds last_updated to updateDoc
func WithNamespacedLastUpdatedUpdate ¶
func WithNamespacedLastUpdatedUpdate(updateDoc bson.M, prefixes []string) (newUpdateDoc bson.M, err error)
WithNamespacedLastUpdatedUpdate adds unique timestamp to updateDoc
func WithNamespacedUniqueTimestampQuery ¶
func WithNamespacedUniqueTimestampQuery(queryDoc bson.M, timestamps []bson.MongoTimestamp, prefixes []string) bson.M
WithNamespacedUniqueTimestampQuery adds unique timestamps to queryDoc sub-docs
func WithNamespacedUniqueTimestampUpdate ¶
func WithNamespacedUniqueTimestampUpdate(updateDoc bson.M, prefixes []string) (newUpdateDoc bson.M, err error)
WithNamespacedUniqueTimestampUpdate adds unique timestamp to updateDoc
func WithNamespacedUpdates ¶
WithNamespacedUpdates adds all timestamps to updateDoc
func WithUniqueTimestampQuery ¶
WithUniqueTimestampQuery adds unique timestamp to queryDoc
func WithUniqueTimestampUpdate ¶
WithUniqueTimestampUpdate adds unique timestamp to updateDoc
Types ¶
type Graceful ¶
type Graceful interface {
// contains filtered or unexported methods
}
Graceful represents an interface to the shutdown method
type Timestamps ¶
type Timestamps struct { LastUpdated time.Time `bson:"last_updated,omitempty" json:"last_updated,omitempty"` UniqueTimestamp *bson.MongoTimestamp `bson:"unique_timestamp,omitempty" json:"-"` }
Timestamps represent an object containing time stamps keep these in sync with above const
Click to show internal directories.
Click to hide internal directories.