1 // Code generated by protoc-gen-go. DO NOT EDIT.
2 // source: google/watcher/v1/watch.proto
5 Package watcher is a generated protocol buffer package.
7 It is generated from these files:
8 google/watcher/v1/watch.proto
10 It has these top-level messages:
17 import proto "github.com/golang/protobuf/proto"
20 import _ "google.golang.org/genproto/googleapis/api/annotations"
21 import google_protobuf1 "github.com/golang/protobuf/ptypes/any"
22 import _ "github.com/golang/protobuf/ptypes/empty"
25 context "golang.org/x/net/context"
26 grpc "google.golang.org/grpc"
29 // Reference imports to suppress errors if they are not otherwise used.
34 // This is a compile-time assertion to ensure that this generated file
35 // is compatible with the proto package it is being compiled against.
36 // A compilation error at this line likely means your copy of the
37 // proto package needs to be updated.
38 const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
40 // A reported value can be in one of the following states:
41 type Change_State int32
44 // The element exists and its full value is included in data.
45 Change_EXISTS Change_State = 0
46 // The element does not exist.
47 Change_DOES_NOT_EXIST Change_State = 1
48 // Element may or may not exist. Used only for initial state delivery when
49 // the client is not interested in fetching the initial state. See the
50 // "Initial State" section above.
51 Change_INITIAL_STATE_SKIPPED Change_State = 2
52 // The element may exist, but some error has occurred. More information is
53 // available in the data field - the value is a serialized Status
54 // proto (from [google.rpc.Status][])
55 Change_ERROR Change_State = 3
58 var Change_State_name = map[int32]string{
61 2: "INITIAL_STATE_SKIPPED",
64 var Change_State_value = map[string]int32{
67 "INITIAL_STATE_SKIPPED": 2,
71 func (x Change_State) String() string {
72 return proto.EnumName(Change_State_name, int32(x))
74 func (Change_State) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{2, 0} }
76 // The message used by the client to register interest in an entity.
78 // The `target` value **must** be a valid URL path pointing to an entity
79 // to watch. Note that the service name **must** be
80 // removed from the target field (e.g., the target field must say
81 // "/foo/bar", not "myservice.googleapis.com/foo/bar"). A client is
82 // also allowed to pass system-specific parameters in the URL that
83 // are only obeyed by some implementations. Some parameters will be
84 // implementation-specific. However, some have predefined meaning
85 // and are listed here:
87 // * recursive = true|false [default=false]
88 // If set to true, indicates that the client wants to watch all elements
89 // of entities in the subtree rooted at the entity's name in `target`. For
90 // descendants that are not the immediate children of the target, the
91 // `Change.element` will contain slashes.
93 // Note that some namespaces and entities will not support recursive
94 // watching. When watching such an entity, a client must not set recursive
95 // to true. Otherwise, it will receive an `UNIMPLEMENTED` error.
97 // Normal URL encoding must be used inside `target`. For example, if a query
98 // parameter name or value, or the non-query parameter portion of `target`
99 // contains a special character, it must be %-encoded. We recommend that
100 // clients and servers use their runtime's URL library to produce and consume
102 Target string `protobuf:"bytes,1,opt,name=target" json:"target,omitempty"`
103 // The `resume_marker` specifies how much of the existing underlying state is
104 // delivered to the client when the watch request is received by the
105 // system. The client can set this marker in one of the following ways to get
106 // different semantics:
108 // * Parameter is not specified or has the value "".
109 // Semantics: Fetch initial state.
110 // The client wants the entity's initial state to be delivered. See the
111 // description in "Initial State".
113 // * Parameter is set to the string "now" (UTF-8 encoding).
114 // Semantics: Fetch new changes only.
115 // The client just wants to get the changes received by the system after
116 // the watch point. The system may deliver changes from before the watch
119 // * Parameter is set to a value received in an earlier
120 // `Change.resume_marker` field while watching the same entity.
121 // Semantics: Resume from a specific point.
122 // The client wants to receive the changes from a specific point; this
123 // value must correspond to a value received in the `Change.resume_marker`
124 // field. The system may deliver changes from before the `resume_marker`
125 // as well. If the system cannot resume the stream from this point (e.g.,
126 // if it is too far behind in the stream), it can raise the
127 // `FAILED_PRECONDITION` error.
129 // An implementation MUST support an unspecified parameter and the
130 // empty string "" marker (initial state fetching) and the "now" marker.
131 // It need not support resuming from a specific point.
132 ResumeMarker []byte `protobuf:"bytes,2,opt,name=resume_marker,json=resumeMarker,proto3" json:"resume_marker,omitempty"`
135 func (m *Request) Reset() { *m = Request{} }
136 func (m *Request) String() string { return proto.CompactTextString(m) }
137 func (*Request) ProtoMessage() {}
138 func (*Request) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} }
140 func (m *Request) GetTarget() string {
147 func (m *Request) GetResumeMarker() []byte {
149 return m.ResumeMarker
154 // A batch of Change messages.
155 type ChangeBatch struct {
156 // A list of Change messages.
157 Changes []*Change `protobuf:"bytes,1,rep,name=changes" json:"changes,omitempty"`
160 func (m *ChangeBatch) Reset() { *m = ChangeBatch{} }
161 func (m *ChangeBatch) String() string { return proto.CompactTextString(m) }
162 func (*ChangeBatch) ProtoMessage() {}
163 func (*ChangeBatch) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} }
165 func (m *ChangeBatch) GetChanges() []*Change {
172 // A Change indicates the most recent state of an element.
174 // Name of the element, interpreted relative to the entity's actual
175 // name. "" refers to the entity itself. The element name is a valid
177 Element string `protobuf:"bytes,1,opt,name=element" json:"element,omitempty"`
178 // The state of the `element`.
179 State Change_State `protobuf:"varint,2,opt,name=state,enum=google.watcher.v1.Change_State" json:"state,omitempty"`
180 // The actual change data. This field is present only when `state() == EXISTS`
181 // or `state() == ERROR`. Please see [google.protobuf.Any][google.protobuf.Any] about how to use
183 Data *google_protobuf1.Any `protobuf:"bytes,6,opt,name=data" json:"data,omitempty"`
184 // If present, provides a compact representation of all the messages that have
185 // been received by the caller for the given entity, e.g., it could be a
186 // sequence number or a multi-part timestamp/version vector. This marker can
187 // be provided in the Request message, allowing the caller to resume the stream
188 // watching at a specific point without fetching the initial state.
189 ResumeMarker []byte `protobuf:"bytes,4,opt,name=resume_marker,json=resumeMarker,proto3" json:"resume_marker,omitempty"`
190 // If true, this Change is followed by more Changes that are in the same group
192 Continued bool `protobuf:"varint,5,opt,name=continued" json:"continued,omitempty"`
195 func (m *Change) Reset() { *m = Change{} }
196 func (m *Change) String() string { return proto.CompactTextString(m) }
197 func (*Change) ProtoMessage() {}
198 func (*Change) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} }
200 func (m *Change) GetElement() string {
207 func (m *Change) GetState() Change_State {
214 func (m *Change) GetData() *google_protobuf1.Any {
221 func (m *Change) GetResumeMarker() []byte {
223 return m.ResumeMarker
228 func (m *Change) GetContinued() bool {
236 proto.RegisterType((*Request)(nil), "google.watcher.v1.Request")
237 proto.RegisterType((*ChangeBatch)(nil), "google.watcher.v1.ChangeBatch")
238 proto.RegisterType((*Change)(nil), "google.watcher.v1.Change")
239 proto.RegisterEnum("google.watcher.v1.Change_State", Change_State_name, Change_State_value)
242 // Reference imports to suppress errors if they are not otherwise used.
243 var _ context.Context
244 var _ grpc.ClientConn
246 // This is a compile-time assertion to ensure that this generated file
247 // is compatible with the grpc package it is being compiled against.
248 const _ = grpc.SupportPackageIsVersion4
250 // Client API for Watcher service
252 type WatcherClient interface {
253 // Start a streaming RPC to get watch information from the server.
254 Watch(ctx context.Context, in *Request, opts ...grpc.CallOption) (Watcher_WatchClient, error)
257 type watcherClient struct {
261 func NewWatcherClient(cc *grpc.ClientConn) WatcherClient {
262 return &watcherClient{cc}
265 func (c *watcherClient) Watch(ctx context.Context, in *Request, opts ...grpc.CallOption) (Watcher_WatchClient, error) {
266 stream, err := grpc.NewClientStream(ctx, &_Watcher_serviceDesc.Streams[0], c.cc, "/google.watcher.v1.Watcher/Watch", opts...)
270 x := &watcherWatchClient{stream}
271 if err := x.ClientStream.SendMsg(in); err != nil {
274 if err := x.ClientStream.CloseSend(); err != nil {
280 type Watcher_WatchClient interface {
281 Recv() (*ChangeBatch, error)
285 type watcherWatchClient struct {
289 func (x *watcherWatchClient) Recv() (*ChangeBatch, error) {
290 m := new(ChangeBatch)
291 if err := x.ClientStream.RecvMsg(m); err != nil {
297 // Server API for Watcher service
299 type WatcherServer interface {
300 // Start a streaming RPC to get watch information from the server.
301 Watch(*Request, Watcher_WatchServer) error
304 func RegisterWatcherServer(s *grpc.Server, srv WatcherServer) {
305 s.RegisterService(&_Watcher_serviceDesc, srv)
308 func _Watcher_Watch_Handler(srv interface{}, stream grpc.ServerStream) error {
310 if err := stream.RecvMsg(m); err != nil {
313 return srv.(WatcherServer).Watch(m, &watcherWatchServer{stream})
316 type Watcher_WatchServer interface {
317 Send(*ChangeBatch) error
321 type watcherWatchServer struct {
325 func (x *watcherWatchServer) Send(m *ChangeBatch) error {
326 return x.ServerStream.SendMsg(m)
329 var _Watcher_serviceDesc = grpc.ServiceDesc{
330 ServiceName: "google.watcher.v1.Watcher",
331 HandlerType: (*WatcherServer)(nil),
332 Methods: []grpc.MethodDesc{},
333 Streams: []grpc.StreamDesc{
336 Handler: _Watcher_Watch_Handler,
340 Metadata: "google/watcher/v1/watch.proto",
343 func init() { proto.RegisterFile("google/watcher/v1/watch.proto", fileDescriptor0) }
345 var fileDescriptor0 = []byte{
346 // 449 bytes of a gzipped FileDescriptorProto
347 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x52, 0xdd, 0x6e, 0xd3, 0x30,
348 0x14, 0xc6, 0xdd, 0x92, 0xd2, 0xd3, 0x31, 0x75, 0x16, 0x43, 0x69, 0x19, 0x10, 0x85, 0x9b, 0x5c,
349 0x25, 0xac, 0x13, 0x12, 0x12, 0x57, 0x2d, 0x0b, 0x52, 0x04, 0x5b, 0x2b, 0x27, 0x12, 0x13, 0x37,
350 0x91, 0x97, 0x99, 0xac, 0xa2, 0xb1, 0x4b, 0xe2, 0x0e, 0xed, 0x96, 0x57, 0x40, 0x3c, 0x19, 0xaf,
351 0xc0, 0x83, 0xa0, 0xda, 0x0e, 0x20, 0xb2, 0xde, 0x9d, 0xf3, 0xfd, 0xd8, 0xe7, 0x3b, 0x36, 0x3c,
352 0x29, 0x84, 0x28, 0x96, 0x2c, 0xfc, 0x4a, 0x65, 0x7e, 0xcd, 0xaa, 0xf0, 0xe6, 0x58, 0x97, 0xc1,
353 0xaa, 0x12, 0x52, 0xe0, 0x03, 0x4d, 0x07, 0x86, 0x0e, 0x6e, 0x8e, 0x47, 0x47, 0xc6, 0x41, 0x57,
354 0x8b, 0x90, 0x72, 0x2e, 0x24, 0x95, 0x0b, 0xc1, 0x6b, 0x6d, 0x18, 0x0d, 0x0d, 0xab, 0xba, 0xcb,
355 0xf5, 0xa7, 0x90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c3, 0xfe, 0xe9, 0x2c, 0x4a, 0xb2, 0xf3, 0x59, 0x9a, 0x29,
367 0x70, 0x80, 0xf0, 0x10, 0x0e, 0xe3, 0xf3, 0x38, 0x8d, 0x27, 0xef, 0xb3, 0x24, 0x9d, 0xa4, 0x51,
368 0x96, 0xbc, 0x8b, 0xe7, 0xf3, 0xe8, 0x74, 0xd0, 0xc1, 0x3d, 0xb0, 0x22, 0x42, 0x66, 0x64, 0xb0,
369 0x33, 0xce, 0xa1, 0xfb, 0x41, 0xa7, 0xc3, 0x17, 0x60, 0xa9, 0x12, 0x8f, 0xee, 0xc8, 0x6d, 0x1e,
370 0x72, 0xf4, 0x74, 0xeb, 0x4e, 0xd4, 0xe3, 0x78, 0x07, 0xdf, 0x7e, 0xfe, 0xfa, 0xde, 0xe9, 0xe3,
371 0xde, 0x9f, 0x5f, 0xf7, 0x02, 0x4d, 0x33, 0x38, 0xcc, 0x45, 0xd9, 0x76, 0x4e, 0x41, 0x5d, 0x38,
372 0xdf, 0x2c, 0x6a, 0x8e, 0x3e, 0xbe, 0x32, 0x82, 0x42, 0x2c, 0x29, 0x2f, 0x02, 0x51, 0x15, 0x61,
373 0xc1, 0xb8, 0x5a, 0x63, 0xa8, 0x29, 0xba, 0x5a, 0xd4, 0xff, 0x7c, 0xeb, 0xd7, 0xa6, 0xbc, 0xb4,
374 0x95, 0xe8, 0xe4, 0x77, 0x00, 0x00, 0x00, 0xff, 0xff, 0x48, 0x0a, 0xba, 0x6c, 0xfa, 0x02, 0x00,