blob: a987327a71d1c357d0ce35019019aac6c3931515 [file] [log] [blame]
Don Newton379ae252019-04-01 12:17:06 -04001// Copyright (C) MongoDB, Inc. 2017-present.
2//
3// Licensed under the Apache License, Version 2.0 (the "License"); you may
4// not use this file except in compliance with the License. You may obtain
5// a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
6
7package wiremessage
8
9import "github.com/mongodb/mongo-go-driver/bson"
10
11// Update represents the OP_UPDATE message of the MongoDB wire protocol.
12type Update struct {
13 MsgHeader Header
14 FullCollectionName string
15 Flags UpdateFlag
16 Selector bson.Raw
17 Update bson.Raw
18}
19
20// MarshalWireMessage implements the Marshaler and WireMessage interfaces.
21func (u Update) MarshalWireMessage() ([]byte, error) {
22 panic("not implemented")
23}
24
25// ValidateWireMessage implements the Validator and WireMessage interfaces.
26func (u Update) ValidateWireMessage() error {
27 panic("not implemented")
28}
29
30// AppendWireMessage implements the Appender and WireMessage interfaces.
31func (u Update) AppendWireMessage([]byte) ([]byte, error) {
32 panic("not implemented")
33}
34
35// String implements the fmt.Stringer interface.
36func (u Update) String() string {
37 panic("not implemented")
38}
39
40// Len implements the WireMessage interface.
41func (u Update) Len() int {
42 panic("not implemented")
43}
44
45// UnmarshalWireMessage implements the Unmarshaler interface.
46func (u *Update) UnmarshalWireMessage([]byte) error {
47 panic("not implemented")
48}
49
50// UpdateFlag represents the flags on an OP_UPDATE message.
51type UpdateFlag int32
52
53// These constants represent the individual flags on an OP_UPDATE message.
54const (
55 Upsert UpdateFlag = 1 << iota
56 MultiUpdate
57)