You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

436 lines
16 KiB

  1. // Code generated by protoc-gen-go. DO NOT EDIT.
  2. // source: google/watcher/v1/watch.proto
  3. package watcher // import "google.golang.org/genproto/googleapis/watcher/v1"
  4. import proto "github.com/golang/protobuf/proto"
  5. import fmt "fmt"
  6. import math "math"
  7. import any "github.com/golang/protobuf/ptypes/any"
  8. import _ "github.com/golang/protobuf/ptypes/empty"
  9. import _ "google.golang.org/genproto/googleapis/api/annotations"
  10. import (
  11. context "golang.org/x/net/context"
  12. grpc "google.golang.org/grpc"
  13. )
  14. // Reference imports to suppress errors if they are not otherwise used.
  15. var _ = proto.Marshal
  16. var _ = fmt.Errorf
  17. var _ = math.Inf
  18. // This is a compile-time assertion to ensure that this generated file
  19. // is compatible with the proto package it is being compiled against.
  20. // A compilation error at this line likely means your copy of the
  21. // proto package needs to be updated.
  22. const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
  23. // A reported value can be in one of the following states:
  24. type Change_State int32
  25. const (
  26. // The element exists and its full value is included in data.
  27. Change_EXISTS Change_State = 0
  28. // The element does not exist.
  29. Change_DOES_NOT_EXIST Change_State = 1
  30. // Element may or may not exist. Used only for initial state delivery when
  31. // the client is not interested in fetching the initial state. See the
  32. // "Initial State" section above.
  33. Change_INITIAL_STATE_SKIPPED Change_State = 2
  34. // The element may exist, but some error has occurred. More information is
  35. // available in the data field - the value is a serialized Status
  36. // proto (from [google.rpc.Status][])
  37. Change_ERROR Change_State = 3
  38. )
  39. var Change_State_name = map[int32]string{
  40. 0: "EXISTS",
  41. 1: "DOES_NOT_EXIST",
  42. 2: "INITIAL_STATE_SKIPPED",
  43. 3: "ERROR",
  44. }
  45. var Change_State_value = map[string]int32{
  46. "EXISTS": 0,
  47. "DOES_NOT_EXIST": 1,
  48. "INITIAL_STATE_SKIPPED": 2,
  49. "ERROR": 3,
  50. }
  51. func (x Change_State) String() string {
  52. return proto.EnumName(Change_State_name, int32(x))
  53. }
  54. func (Change_State) EnumDescriptor() ([]byte, []int) {
  55. return fileDescriptor_watch_49d401f698d4e743, []int{2, 0}
  56. }
  57. // The message used by the client to register interest in an entity.
  58. type Request struct {
  59. // The `target` value **must** be a valid URL path pointing to an entity
  60. // to watch. Note that the service name **must** be
  61. // removed from the target field (e.g., the target field must say
  62. // "/foo/bar", not "myservice.googleapis.com/foo/bar"). A client is
  63. // also allowed to pass system-specific parameters in the URL that
  64. // are only obeyed by some implementations. Some parameters will be
  65. // implementation-specific. However, some have predefined meaning
  66. // and are listed here:
  67. //
  68. // * recursive = true|false [default=false]
  69. // If set to true, indicates that the client wants to watch all elements
  70. // of entities in the subtree rooted at the entity's name in `target`. For
  71. // descendants that are not the immediate children of the target, the
  72. // `Change.element` will contain slashes.
  73. //
  74. // Note that some namespaces and entities will not support recursive
  75. // watching. When watching such an entity, a client must not set recursive
  76. // to true. Otherwise, it will receive an `UNIMPLEMENTED` error.
  77. //
  78. // Normal URL encoding must be used inside `target`. For example, if a query
  79. // parameter name or value, or the non-query parameter portion of `target`
  80. // contains a special character, it must be %-encoded. We recommend that
  81. // clients and servers use their runtime's URL library to produce and consume
  82. // target values.
  83. Target string `protobuf:"bytes,1,opt,name=target,proto3" json:"target,omitempty"`
  84. // The `resume_marker` specifies how much of the existing underlying state is
  85. // delivered to the client when the watch request is received by the
  86. // system. The client can set this marker in one of the following ways to get
  87. // different semantics:
  88. //
  89. // * Parameter is not specified or has the value "".
  90. // Semantics: Fetch initial state.
  91. // The client wants the entity's initial state to be delivered. See the
  92. // description in "Initial State".
  93. //
  94. // * Parameter is set to the string "now" (UTF-8 encoding).
  95. // Semantics: Fetch new changes only.
  96. // The client just wants to get the changes received by the system after
  97. // the watch point. The system may deliver changes from before the watch
  98. // point as well.
  99. //
  100. // * Parameter is set to a value received in an earlier
  101. // `Change.resume_marker` field while watching the same entity.
  102. // Semantics: Resume from a specific point.
  103. // The client wants to receive the changes from a specific point; this
  104. // value must correspond to a value received in the `Change.resume_marker`
  105. // field. The system may deliver changes from before the `resume_marker`
  106. // as well. If the system cannot resume the stream from this point (e.g.,
  107. // if it is too far behind in the stream), it can raise the
  108. // `FAILED_PRECONDITION` error.
  109. //
  110. // An implementation MUST support an unspecified parameter and the
  111. // empty string "" marker (initial state fetching) and the "now" marker.
  112. // It need not support resuming from a specific point.
  113. ResumeMarker []byte `protobuf:"bytes,2,opt,name=resume_marker,json=resumeMarker,proto3" json:"resume_marker,omitempty"`
  114. XXX_NoUnkeyedLiteral struct{} `json:"-"`
  115. XXX_unrecognized []byte `json:"-"`
  116. XXX_sizecache int32 `json:"-"`
  117. }
  118. func (m *Request) Reset() { *m = Request{} }
  119. func (m *Request) String() string { return proto.CompactTextString(m) }
  120. func (*Request) ProtoMessage() {}
  121. func (*Request) Descriptor() ([]byte, []int) {
  122. return fileDescriptor_watch_49d401f698d4e743, []int{0}
  123. }
  124. func (m *Request) XXX_Unmarshal(b []byte) error {
  125. return xxx_messageInfo_Request.Unmarshal(m, b)
  126. }
  127. func (m *Request) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  128. return xxx_messageInfo_Request.Marshal(b, m, deterministic)
  129. }
  130. func (dst *Request) XXX_Merge(src proto.Message) {
  131. xxx_messageInfo_Request.Merge(dst, src)
  132. }
  133. func (m *Request) XXX_Size() int {
  134. return xxx_messageInfo_Request.Size(m)
  135. }
  136. func (m *Request) XXX_DiscardUnknown() {
  137. xxx_messageInfo_Request.DiscardUnknown(m)
  138. }
  139. var xxx_messageInfo_Request proto.InternalMessageInfo
  140. func (m *Request) GetTarget() string {
  141. if m != nil {
  142. return m.Target
  143. }
  144. return ""
  145. }
  146. func (m *Request) GetResumeMarker() []byte {
  147. if m != nil {
  148. return m.ResumeMarker
  149. }
  150. return nil
  151. }
  152. // A batch of Change messages.
  153. type ChangeBatch struct {
  154. // A list of Change messages.
  155. Changes []*Change `protobuf:"bytes,1,rep,name=changes,proto3" json:"changes,omitempty"`
  156. XXX_NoUnkeyedLiteral struct{} `json:"-"`
  157. XXX_unrecognized []byte `json:"-"`
  158. XXX_sizecache int32 `json:"-"`
  159. }
  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) {
  164. return fileDescriptor_watch_49d401f698d4e743, []int{1}
  165. }
  166. func (m *ChangeBatch) XXX_Unmarshal(b []byte) error {
  167. return xxx_messageInfo_ChangeBatch.Unmarshal(m, b)
  168. }
  169. func (m *ChangeBatch) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  170. return xxx_messageInfo_ChangeBatch.Marshal(b, m, deterministic)
  171. }
  172. func (dst *ChangeBatch) XXX_Merge(src proto.Message) {
  173. xxx_messageInfo_ChangeBatch.Merge(dst, src)
  174. }
  175. func (m *ChangeBatch) XXX_Size() int {
  176. return xxx_messageInfo_ChangeBatch.Size(m)
  177. }
  178. func (m *ChangeBatch) XXX_DiscardUnknown() {
  179. xxx_messageInfo_ChangeBatch.DiscardUnknown(m)
  180. }
  181. var xxx_messageInfo_ChangeBatch proto.InternalMessageInfo
  182. func (m *ChangeBatch) GetChanges() []*Change {
  183. if m != nil {
  184. return m.Changes
  185. }
  186. return nil
  187. }
  188. // A Change indicates the most recent state of an element.
  189. type Change struct {
  190. // Name of the element, interpreted relative to the entity's actual
  191. // name. "" refers to the entity itself. The element name is a valid
  192. // UTF-8 string.
  193. Element string `protobuf:"bytes,1,opt,name=element,proto3" json:"element,omitempty"`
  194. // The state of the `element`.
  195. State Change_State `protobuf:"varint,2,opt,name=state,proto3,enum=google.watcher.v1.Change_State" json:"state,omitempty"`
  196. // The actual change data. This field is present only when `state() == EXISTS`
  197. // or `state() == ERROR`. Please see
  198. // [google.protobuf.Any][google.protobuf.Any] about how to use the Any type.
  199. Data *any.Any `protobuf:"bytes,6,opt,name=data,proto3" json:"data,omitempty"`
  200. // If present, provides a compact representation of all the messages that have
  201. // been received by the caller for the given entity, e.g., it could be a
  202. // sequence number or a multi-part timestamp/version vector. This marker can
  203. // be provided in the Request message, allowing the caller to resume the
  204. // stream watching at a specific point without fetching the initial state.
  205. ResumeMarker []byte `protobuf:"bytes,4,opt,name=resume_marker,json=resumeMarker,proto3" json:"resume_marker,omitempty"`
  206. // If true, this Change is followed by more Changes that are in the same group
  207. // as this Change.
  208. Continued bool `protobuf:"varint,5,opt,name=continued,proto3" json:"continued,omitempty"`
  209. XXX_NoUnkeyedLiteral struct{} `json:"-"`
  210. XXX_unrecognized []byte `json:"-"`
  211. XXX_sizecache int32 `json:"-"`
  212. }
  213. func (m *Change) Reset() { *m = Change{} }
  214. func (m *Change) String() string { return proto.CompactTextString(m) }
  215. func (*Change) ProtoMessage() {}
  216. func (*Change) Descriptor() ([]byte, []int) {
  217. return fileDescriptor_watch_49d401f698d4e743, []int{2}
  218. }
  219. func (m *Change) XXX_Unmarshal(b []byte) error {
  220. return xxx_messageInfo_Change.Unmarshal(m, b)
  221. }
  222. func (m *Change) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  223. return xxx_messageInfo_Change.Marshal(b, m, deterministic)
  224. }
  225. func (dst *Change) XXX_Merge(src proto.Message) {
  226. xxx_messageInfo_Change.Merge(dst, src)
  227. }
  228. func (m *Change) XXX_Size() int {
  229. return xxx_messageInfo_Change.Size(m)
  230. }
  231. func (m *Change) XXX_DiscardUnknown() {
  232. xxx_messageInfo_Change.DiscardUnknown(m)
  233. }
  234. var xxx_messageInfo_Change proto.InternalMessageInfo
  235. func (m *Change) GetElement() string {
  236. if m != nil {
  237. return m.Element
  238. }
  239. return ""
  240. }
  241. func (m *Change) GetState() Change_State {
  242. if m != nil {
  243. return m.State
  244. }
  245. return Change_EXISTS
  246. }
  247. func (m *Change) GetData() *any.Any {
  248. if m != nil {
  249. return m.Data
  250. }
  251. return nil
  252. }
  253. func (m *Change) GetResumeMarker() []byte {
  254. if m != nil {
  255. return m.ResumeMarker
  256. }
  257. return nil
  258. }
  259. func (m *Change) GetContinued() bool {
  260. if m != nil {
  261. return m.Continued
  262. }
  263. return false
  264. }
  265. func init() {
  266. proto.RegisterType((*Request)(nil), "google.watcher.v1.Request")
  267. proto.RegisterType((*ChangeBatch)(nil), "google.watcher.v1.ChangeBatch")
  268. proto.RegisterType((*Change)(nil), "google.watcher.v1.Change")
  269. proto.RegisterEnum("google.watcher.v1.Change_State", Change_State_name, Change_State_value)
  270. }
  271. // Reference imports to suppress errors if they are not otherwise used.
  272. var _ context.Context
  273. var _ grpc.ClientConn
  274. // This is a compile-time assertion to ensure that this generated file
  275. // is compatible with the grpc package it is being compiled against.
  276. const _ = grpc.SupportPackageIsVersion4
  277. // WatcherClient is the client API for Watcher service.
  278. //
  279. // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
  280. type WatcherClient interface {
  281. // Start a streaming RPC to get watch information from the server.
  282. Watch(ctx context.Context, in *Request, opts ...grpc.CallOption) (Watcher_WatchClient, error)
  283. }
  284. type watcherClient struct {
  285. cc *grpc.ClientConn
  286. }
  287. func NewWatcherClient(cc *grpc.ClientConn) WatcherClient {
  288. return &watcherClient{cc}
  289. }
  290. func (c *watcherClient) Watch(ctx context.Context, in *Request, opts ...grpc.CallOption) (Watcher_WatchClient, error) {
  291. stream, err := c.cc.NewStream(ctx, &_Watcher_serviceDesc.Streams[0], "/google.watcher.v1.Watcher/Watch", opts...)
  292. if err != nil {
  293. return nil, err
  294. }
  295. x := &watcherWatchClient{stream}
  296. if err := x.ClientStream.SendMsg(in); err != nil {
  297. return nil, err
  298. }
  299. if err := x.ClientStream.CloseSend(); err != nil {
  300. return nil, err
  301. }
  302. return x, nil
  303. }
  304. type Watcher_WatchClient interface {
  305. Recv() (*ChangeBatch, error)
  306. grpc.ClientStream
  307. }
  308. type watcherWatchClient struct {
  309. grpc.ClientStream
  310. }
  311. func (x *watcherWatchClient) Recv() (*ChangeBatch, error) {
  312. m := new(ChangeBatch)
  313. if err := x.ClientStream.RecvMsg(m); err != nil {
  314. return nil, err
  315. }
  316. return m, nil
  317. }
  318. // WatcherServer is the server API for Watcher service.
  319. type WatcherServer interface {
  320. // Start a streaming RPC to get watch information from the server.
  321. Watch(*Request, Watcher_WatchServer) error
  322. }
  323. func RegisterWatcherServer(s *grpc.Server, srv WatcherServer) {
  324. s.RegisterService(&_Watcher_serviceDesc, srv)
  325. }
  326. func _Watcher_Watch_Handler(srv interface{}, stream grpc.ServerStream) error {
  327. m := new(Request)
  328. if err := stream.RecvMsg(m); err != nil {
  329. return err
  330. }
  331. return srv.(WatcherServer).Watch(m, &watcherWatchServer{stream})
  332. }
  333. type Watcher_WatchServer interface {
  334. Send(*ChangeBatch) error
  335. grpc.ServerStream
  336. }
  337. type watcherWatchServer struct {
  338. grpc.ServerStream
  339. }
  340. func (x *watcherWatchServer) Send(m *ChangeBatch) error {
  341. return x.ServerStream.SendMsg(m)
  342. }
  343. var _Watcher_serviceDesc = grpc.ServiceDesc{
  344. ServiceName: "google.watcher.v1.Watcher",
  345. HandlerType: (*WatcherServer)(nil),
  346. Methods: []grpc.MethodDesc{},
  347. Streams: []grpc.StreamDesc{
  348. {
  349. StreamName: "Watch",
  350. Handler: _Watcher_Watch_Handler,
  351. ServerStreams: true,
  352. },
  353. },
  354. Metadata: "google/watcher/v1/watch.proto",
  355. }
  356. func init() {
  357. proto.RegisterFile("google/watcher/v1/watch.proto", fileDescriptor_watch_49d401f698d4e743)
  358. }
  359. var fileDescriptor_watch_49d401f698d4e743 = []byte{
  360. // 449 bytes of a gzipped FileDescriptorProto
  361. 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x52, 0xdd, 0x6e, 0xd3, 0x30,
  362. 0x14, 0xc6, 0xdd, 0x92, 0xd2, 0xd3, 0x31, 0x75, 0x16, 0x43, 0x69, 0x19, 0x10, 0x85, 0x9b, 0x5c,
  363. 0x25, 0xac, 0x13, 0x12, 0x12, 0x57, 0x2d, 0x0b, 0x52, 0x04, 0x5b, 0x2b, 0x27, 0x12, 0x13, 0x37,
  364. 0x91, 0x97, 0x99, 0xac, 0xa2, 0xb1, 0x4b, 0xe2, 0x0e, 0xed, 0x96, 0x57, 0x40, 0x3c, 0x19, 0xaf,
  365. 0xc0, 0x83, 0xa0, 0xda, 0x0e, 0x20, 0xb2, 0xde, 0x9d, 0xf3, 0xfd, 0xd8, 0xe7, 0x3b, 0x36, 0x3c,
  366. 0x29, 0x84, 0x28, 0x96, 0x2c, 0xfc, 0x4a, 0x65, 0x7e, 0xcd, 0xaa, 0xf0, 0xe6, 0x58, 0x97, 0xc1,
  367. 0xaa, 0x12, 0x52, 0xe0, 0x03, 0x4d, 0x07, 0x86, 0x0e, 0x6e, 0x8e, 0x47, 0x47, 0xc6, 0x41, 0x57,
  368. 0x8b, 0x90, 0x72, 0x2e, 0x24, 0x95, 0x0b, 0xc1, 0x6b, 0x6d, 0x18, 0x0d, 0x0d, 0xab, 0xba, 0xcb,
  369. 0xf5, 0xa7, 0x90, 0xf2, 0x5b, 0x43, 0x3d, 0xfe, 0x9f, 0x62, 0xe5, 0x4a, 0x1a, 0xd2, 0x7b, 0x0b,
  370. 0x5d, 0xc2, 0xbe, 0xac, 0x59, 0x2d, 0xf1, 0x23, 0xb0, 0x25, 0xad, 0x0a, 0x26, 0x1d, 0xe4, 0x22,
  371. 0xbf, 0x47, 0x4c, 0x87, 0x9f, 0xc3, 0x83, 0x8a, 0xd5, 0xeb, 0x92, 0x65, 0x25, 0xad, 0x3e, 0xb3,
  372. 0xca, 0xe9, 0xb8, 0xc8, 0xdf, 0x23, 0x7b, 0x1a, 0x3c, 0x53, 0x98, 0x37, 0x85, 0xfe, 0x9b, 0x6b,
  373. 0xca, 0x0b, 0x36, 0xdd, 0x4c, 0x8c, 0x4f, 0xa0, 0x9b, 0xab, 0xb6, 0x76, 0x90, 0xbb, 0xe3, 0xf7,
  374. 0xc7, 0xc3, 0xa0, 0x95, 0x28, 0xd0, 0x06, 0xd2, 0x28, 0xbd, 0x1f, 0x1d, 0xb0, 0x35, 0x86, 0x1d,
  375. 0xe8, 0xb2, 0x25, 0x2b, 0x19, 0x6f, 0x86, 0x69, 0x5a, 0xfc, 0x12, 0xac, 0x5a, 0x52, 0xc9, 0xd4,
  376. 0x14, 0xfb, 0xe3, 0x67, 0x5b, 0xcf, 0x0d, 0x92, 0x8d, 0x8c, 0x68, 0x35, 0xf6, 0x61, 0xf7, 0x8a,
  377. 0x4a, 0xea, 0xd8, 0x2e, 0xf2, 0xfb, 0xe3, 0x87, 0x8d, 0xab, 0xd9, 0x49, 0x30, 0xe1, 0xb7, 0x44,
  378. 0x29, 0xda, 0x71, 0x77, 0xdb, 0x71, 0xf1, 0x11, 0xf4, 0x72, 0xc1, 0xe5, 0x82, 0xaf, 0xd9, 0x95,
  379. 0x63, 0xb9, 0xc8, 0xbf, 0x4f, 0xfe, 0x02, 0xde, 0x19, 0x58, 0xea, 0x72, 0x0c, 0x60, 0x47, 0x17,
  380. 0x71, 0x92, 0x26, 0x83, 0x7b, 0x18, 0xc3, 0xfe, 0xe9, 0x2c, 0x4a, 0xb2, 0xf3, 0x59, 0x9a, 0x29,
  381. 0x70, 0x80, 0xf0, 0x10, 0x0e, 0xe3, 0xf3, 0x38, 0x8d, 0x27, 0xef, 0xb3, 0x24, 0x9d, 0xa4, 0x51,
  382. 0x96, 0xbc, 0x8b, 0xe7, 0xf3, 0xe8, 0x74, 0xd0, 0xc1, 0x3d, 0xb0, 0x22, 0x42, 0x66, 0x64, 0xb0,
  383. 0x33, 0xce, 0xa1, 0xfb, 0x41, 0xa7, 0xc3, 0x17, 0x60, 0xa9, 0x12, 0x8f, 0xee, 0xc8, 0x6d, 0x1e,
  384. 0x72, 0xf4, 0x74, 0xeb, 0x4e, 0xd4, 0xe3, 0x78, 0x07, 0xdf, 0x7e, 0xfe, 0xfa, 0xde, 0xe9, 0xe3,
  385. 0xde, 0x9f, 0x5f, 0xf7, 0x02, 0x4d, 0x33, 0x38, 0xcc, 0x45, 0xd9, 0x76, 0x4e, 0x41, 0x5d, 0x38,
  386. 0xdf, 0x2c, 0x6a, 0x8e, 0x3e, 0xbe, 0x32, 0x82, 0x42, 0x2c, 0x29, 0x2f, 0x02, 0x51, 0x15, 0x61,
  387. 0xc1, 0xb8, 0x5a, 0x63, 0xa8, 0x29, 0xba, 0x5a, 0xd4, 0xff, 0x7c, 0xeb, 0xd7, 0xa6, 0xbc, 0xb4,
  388. 0x95, 0xe8, 0xe4, 0x77, 0x00, 0x00, 0x00, 0xff, 0xff, 0x48, 0x0a, 0xba, 0x6c, 0xfa, 0x02, 0x00,
  389. 0x00,
  390. }