Don Newton | 379ae25 | 2019-04-01 12:17:06 -0400 | [diff] [blame^] | 1 | // 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 | |
| 7 | package wiremessage |
| 8 | |
| 9 | import "github.com/mongodb/mongo-go-driver/bson" |
| 10 | |
| 11 | // Update represents the OP_UPDATE message of the MongoDB wire protocol. |
| 12 | type 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. |
| 21 | func (u Update) MarshalWireMessage() ([]byte, error) { |
| 22 | panic("not implemented") |
| 23 | } |
| 24 | |
| 25 | // ValidateWireMessage implements the Validator and WireMessage interfaces. |
| 26 | func (u Update) ValidateWireMessage() error { |
| 27 | panic("not implemented") |
| 28 | } |
| 29 | |
| 30 | // AppendWireMessage implements the Appender and WireMessage interfaces. |
| 31 | func (u Update) AppendWireMessage([]byte) ([]byte, error) { |
| 32 | panic("not implemented") |
| 33 | } |
| 34 | |
| 35 | // String implements the fmt.Stringer interface. |
| 36 | func (u Update) String() string { |
| 37 | panic("not implemented") |
| 38 | } |
| 39 | |
| 40 | // Len implements the WireMessage interface. |
| 41 | func (u Update) Len() int { |
| 42 | panic("not implemented") |
| 43 | } |
| 44 | |
| 45 | // UnmarshalWireMessage implements the Unmarshaler interface. |
| 46 | func (u *Update) UnmarshalWireMessage([]byte) error { |
| 47 | panic("not implemented") |
| 48 | } |
| 49 | |
| 50 | // UpdateFlag represents the flags on an OP_UPDATE message. |
| 51 | type UpdateFlag int32 |
| 52 | |
| 53 | // These constants represent the individual flags on an OP_UPDATE message. |
| 54 | const ( |
| 55 | Upsert UpdateFlag = 1 << iota |
| 56 | MultiUpdate |
| 57 | ) |