-
Notifications
You must be signed in to change notification settings - Fork 0
/
object.go
37 lines (30 loc) · 1.11 KB
/
object.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package object
import (
"fmt"
"google.golang.org/protobuf/proto"
)
// GotenObjectExt is implemented by a Go representation of
// a protobuf message for which protoc-goten-gen-object
// plugin was used. GotenObjectExt is basically an extension
// of a regular go-protobuf object containing many additional
// goten-specific features like type-safe embedded field paths,
// field masks, diff support, customized merge support etc.
// Those extensions are mandatory resources, optional for
// others.
type GotenObjectExt interface {
fmt.Stringer
proto.Message
GotenObjectExt()
// CloneRaw clones current object.
CloneRaw() GotenObjectExt
// MergeRaw merges provided source into current object.
MergeRaw(GotenObjectExt)
// MakeRawFullFieldMask returns full mask. Full field mask contains
// paths of all fields without sub paths items,
// as it is considered that field path already contains
// sub paths.
MakeRawFullFieldMask() FieldMask
// MakeRawDiffFieldMask returns diff mask compared with given resource.
// Panics, if other resource is not of same type.
MakeRawDiffFieldMask(other GotenObjectExt) FieldMask
}