xref: /aosp_15_r20/external/bazelbuild-remote-apis/build/bazel/remote/logstream/v1/remote_logstream.pb.go (revision ae21b2b400d1606a797985382019aea74177085c)
1// Copyright 2020 The Bazel Authors.
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15// Log Stream API
16
17// Code generated by protoc-gen-go. DO NOT EDIT.
18// versions:
19// 	protoc-gen-go v1.31.0
20// 	protoc        v3.15.0
21// source: build/bazel/remote/logstream/v1/remote_logstream.proto
22
23package remotelogstream
24
25import (
26	context "context"
27	grpc "google.golang.org/grpc"
28	codes "google.golang.org/grpc/codes"
29	status "google.golang.org/grpc/status"
30	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
31	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
32	reflect "reflect"
33	sync "sync"
34)
35
36const (
37	// Verify that this generated code is sufficiently up-to-date.
38	_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
39	// Verify that runtime/protoimpl is sufficiently up-to-date.
40	_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
41)
42
43// Contains all information necessary to create a new LogStream resource.
44type CreateLogStreamRequest struct {
45	state         protoimpl.MessageState
46	sizeCache     protoimpl.SizeCache
47	unknownFields protoimpl.UnknownFields
48
49	// Required. The parent resource of the created LogStream.
50	// The list of valid types of parent resources of LogStreams is up to the
51	// implementing server.
52	// Example: projects/123
53	Parent string `protobuf:"bytes,1,opt,name=parent,proto3" json:"parent,omitempty"`
54}
55
56func (x *CreateLogStreamRequest) Reset() {
57	*x = CreateLogStreamRequest{}
58	if protoimpl.UnsafeEnabled {
59		mi := &file_build_bazel_remote_logstream_v1_remote_logstream_proto_msgTypes[0]
60		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
61		ms.StoreMessageInfo(mi)
62	}
63}
64
65func (x *CreateLogStreamRequest) String() string {
66	return protoimpl.X.MessageStringOf(x)
67}
68
69func (*CreateLogStreamRequest) ProtoMessage() {}
70
71func (x *CreateLogStreamRequest) ProtoReflect() protoreflect.Message {
72	mi := &file_build_bazel_remote_logstream_v1_remote_logstream_proto_msgTypes[0]
73	if protoimpl.UnsafeEnabled && x != nil {
74		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
75		if ms.LoadMessageInfo() == nil {
76			ms.StoreMessageInfo(mi)
77		}
78		return ms
79	}
80	return mi.MessageOf(x)
81}
82
83// Deprecated: Use CreateLogStreamRequest.ProtoReflect.Descriptor instead.
84func (*CreateLogStreamRequest) Descriptor() ([]byte, []int) {
85	return file_build_bazel_remote_logstream_v1_remote_logstream_proto_rawDescGZIP(), []int{0}
86}
87
88func (x *CreateLogStreamRequest) GetParent() string {
89	if x != nil {
90		return x.Parent
91	}
92	return ""
93}
94
95// A handle to a log (an ordered sequence of bytes).
96type LogStream struct {
97	state         protoimpl.MessageState
98	sizeCache     protoimpl.SizeCache
99	unknownFields protoimpl.UnknownFields
100
101	// Structured name of the resource in the format:
102	//
103	//	{parent=**}/logstreams/{logstream_id}
104	//	Example: projects/123/logstreams/456-def
105	//
106	// Attempting to call the Byte Stream API's `Write` RPC with a LogStream's
107	//
108	//	`name` as the value for `ByteStream.Write.resource_name` is an error.
109	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
110	// Resource name to pass to `ByteStream.Write` in the format:
111	//
112	//	{parent=**}/logstreams/{logstream_id}/{write_token}
113	//	Example: projects/123/logstreams/456-def/789-ghi
114	//
115	// Attempting to call the Byte Stream API's `Read` RPC with a LogStream's
116	//
117	//	`write_resource_name` as the value for `ByteStream.Write.resource_name`
118	//	is an error.
119	//
120	// `write_resource_name` is separate from `name` to ensure that only the
121	// intended writers can write to a given LogStream. Writers must address write
122	// operations to the `write_resource_name`, not the `name`, and must have
123	// permission to write LogStreams. `write_resource_name` embeds a secret token
124	// and should be protected accordingly; a mishandled `write_resource_name` can
125	// result in unintended writers corrupting the LogStream. Therefore, the field
126	// should be excluded from calls to any calls which retrieve LogStream
127	// metadata (i.e.: `GetLogStream`).
128	//
129	// Bytes written to this resource must to be readable when `ByteStream.Read`
130	// is called with the `name` resource.
131	// Reading a write_resource_name must return an INVALID_ARGUMENT error.
132	WriteResourceName string `protobuf:"bytes,2,opt,name=write_resource_name,json=writeResourceName,proto3" json:"write_resource_name,omitempty"`
133}
134
135func (x *LogStream) Reset() {
136	*x = LogStream{}
137	if protoimpl.UnsafeEnabled {
138		mi := &file_build_bazel_remote_logstream_v1_remote_logstream_proto_msgTypes[1]
139		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
140		ms.StoreMessageInfo(mi)
141	}
142}
143
144func (x *LogStream) String() string {
145	return protoimpl.X.MessageStringOf(x)
146}
147
148func (*LogStream) ProtoMessage() {}
149
150func (x *LogStream) ProtoReflect() protoreflect.Message {
151	mi := &file_build_bazel_remote_logstream_v1_remote_logstream_proto_msgTypes[1]
152	if protoimpl.UnsafeEnabled && x != nil {
153		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
154		if ms.LoadMessageInfo() == nil {
155			ms.StoreMessageInfo(mi)
156		}
157		return ms
158	}
159	return mi.MessageOf(x)
160}
161
162// Deprecated: Use LogStream.ProtoReflect.Descriptor instead.
163func (*LogStream) Descriptor() ([]byte, []int) {
164	return file_build_bazel_remote_logstream_v1_remote_logstream_proto_rawDescGZIP(), []int{1}
165}
166
167func (x *LogStream) GetName() string {
168	if x != nil {
169		return x.Name
170	}
171	return ""
172}
173
174func (x *LogStream) GetWriteResourceName() string {
175	if x != nil {
176		return x.WriteResourceName
177	}
178	return ""
179}
180
181var File_build_bazel_remote_logstream_v1_remote_logstream_proto protoreflect.FileDescriptor
182
183var file_build_bazel_remote_logstream_v1_remote_logstream_proto_rawDesc = []byte{
184	0x0a, 0x36, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x2f, 0x62, 0x61, 0x7a, 0x65, 0x6c, 0x2f, 0x72, 0x65,
185	0x6d, 0x6f, 0x74, 0x65, 0x2f, 0x6c, 0x6f, 0x67, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x2f, 0x76,
186	0x31, 0x2f, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x5f, 0x6c, 0x6f, 0x67, 0x73, 0x74, 0x72, 0x65,
187	0x61, 0x6d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1f, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x2e,
188	0x62, 0x61, 0x7a, 0x65, 0x6c, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x2e, 0x6c, 0x6f, 0x67,
189	0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x2e, 0x76, 0x31, 0x22, 0x30, 0x0a, 0x16, 0x43, 0x72, 0x65,
190	0x61, 0x74, 0x65, 0x4c, 0x6f, 0x67, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x52, 0x65, 0x71, 0x75,
191	0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20,
192	0x01, 0x28, 0x09, 0x52, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x22, 0x4f, 0x0a, 0x09, 0x4c,
193	0x6f, 0x67, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65,
194	0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x2e, 0x0a, 0x13,
195	0x77, 0x72, 0x69, 0x74, 0x65, 0x5f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x6e,
196	0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x11, 0x77, 0x72, 0x69, 0x74, 0x65,
197	0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x32, 0x8c, 0x01, 0x0a,
198	0x10, 0x4c, 0x6f, 0x67, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63,
199	0x65, 0x12, 0x78, 0x0a, 0x0f, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4c, 0x6f, 0x67, 0x53, 0x74,
200	0x72, 0x65, 0x61, 0x6d, 0x12, 0x37, 0x2e, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x2e, 0x62, 0x61, 0x7a,
201	0x65, 0x6c, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x2e, 0x6c, 0x6f, 0x67, 0x73, 0x74, 0x72,
202	0x65, 0x61, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4c, 0x6f, 0x67,
203	0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2a, 0x2e,
204	0x62, 0x75, 0x69, 0x6c, 0x64, 0x2e, 0x62, 0x61, 0x7a, 0x65, 0x6c, 0x2e, 0x72, 0x65, 0x6d, 0x6f,
205	0x74, 0x65, 0x2e, 0x6c, 0x6f, 0x67, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x2e, 0x76, 0x31, 0x2e,
206	0x4c, 0x6f, 0x67, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x22, 0x00, 0x42, 0xb3, 0x01, 0x0a, 0x1f,
207	0x62, 0x75, 0x69, 0x6c, 0x64, 0x2e, 0x62, 0x61, 0x7a, 0x65, 0x6c, 0x2e, 0x72, 0x65, 0x6d, 0x6f,
208	0x74, 0x65, 0x2e, 0x6c, 0x6f, 0x67, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x2e, 0x76, 0x31, 0x42,
209	0x14, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x4c, 0x6f, 0x67, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d,
210	0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x51, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e,
211	0x63, 0x6f, 0x6d, 0x2f, 0x62, 0x61, 0x7a, 0x65, 0x6c, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x2f, 0x72,
212	0x65, 0x6d, 0x6f, 0x74, 0x65, 0x2d, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x62, 0x75, 0x69, 0x6c, 0x64,
213	0x2f, 0x62, 0x61, 0x7a, 0x65, 0x6c, 0x2f, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x2f, 0x6c, 0x6f,
214	0x67, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x2f, 0x76, 0x31, 0x3b, 0x72, 0x65, 0x6d, 0x6f, 0x74,
215	0x65, 0x6c, 0x6f, 0x67, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0xa2, 0x02, 0x02, 0x52, 0x4c, 0xaa,
216	0x02, 0x1f, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x2e, 0x42, 0x61, 0x7a, 0x65, 0x6c, 0x2e, 0x52, 0x65,
217	0x6d, 0x6f, 0x74, 0x65, 0x2e, 0x4c, 0x6f, 0x67, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x2e, 0x76,
218	0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
219}
220
221var (
222	file_build_bazel_remote_logstream_v1_remote_logstream_proto_rawDescOnce sync.Once
223	file_build_bazel_remote_logstream_v1_remote_logstream_proto_rawDescData = file_build_bazel_remote_logstream_v1_remote_logstream_proto_rawDesc
224)
225
226func file_build_bazel_remote_logstream_v1_remote_logstream_proto_rawDescGZIP() []byte {
227	file_build_bazel_remote_logstream_v1_remote_logstream_proto_rawDescOnce.Do(func() {
228		file_build_bazel_remote_logstream_v1_remote_logstream_proto_rawDescData = protoimpl.X.CompressGZIP(file_build_bazel_remote_logstream_v1_remote_logstream_proto_rawDescData)
229	})
230	return file_build_bazel_remote_logstream_v1_remote_logstream_proto_rawDescData
231}
232
233var file_build_bazel_remote_logstream_v1_remote_logstream_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
234var file_build_bazel_remote_logstream_v1_remote_logstream_proto_goTypes = []interface{}{
235	(*CreateLogStreamRequest)(nil), // 0: build.bazel.remote.logstream.v1.CreateLogStreamRequest
236	(*LogStream)(nil),              // 1: build.bazel.remote.logstream.v1.LogStream
237}
238var file_build_bazel_remote_logstream_v1_remote_logstream_proto_depIdxs = []int32{
239	0, // 0: build.bazel.remote.logstream.v1.LogStreamService.CreateLogStream:input_type -> build.bazel.remote.logstream.v1.CreateLogStreamRequest
240	1, // 1: build.bazel.remote.logstream.v1.LogStreamService.CreateLogStream:output_type -> build.bazel.remote.logstream.v1.LogStream
241	1, // [1:2] is the sub-list for method output_type
242	0, // [0:1] is the sub-list for method input_type
243	0, // [0:0] is the sub-list for extension type_name
244	0, // [0:0] is the sub-list for extension extendee
245	0, // [0:0] is the sub-list for field type_name
246}
247
248func init() { file_build_bazel_remote_logstream_v1_remote_logstream_proto_init() }
249func file_build_bazel_remote_logstream_v1_remote_logstream_proto_init() {
250	if File_build_bazel_remote_logstream_v1_remote_logstream_proto != nil {
251		return
252	}
253	if !protoimpl.UnsafeEnabled {
254		file_build_bazel_remote_logstream_v1_remote_logstream_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
255			switch v := v.(*CreateLogStreamRequest); i {
256			case 0:
257				return &v.state
258			case 1:
259				return &v.sizeCache
260			case 2:
261				return &v.unknownFields
262			default:
263				return nil
264			}
265		}
266		file_build_bazel_remote_logstream_v1_remote_logstream_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
267			switch v := v.(*LogStream); i {
268			case 0:
269				return &v.state
270			case 1:
271				return &v.sizeCache
272			case 2:
273				return &v.unknownFields
274			default:
275				return nil
276			}
277		}
278	}
279	type x struct{}
280	out := protoimpl.TypeBuilder{
281		File: protoimpl.DescBuilder{
282			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
283			RawDescriptor: file_build_bazel_remote_logstream_v1_remote_logstream_proto_rawDesc,
284			NumEnums:      0,
285			NumMessages:   2,
286			NumExtensions: 0,
287			NumServices:   1,
288		},
289		GoTypes:           file_build_bazel_remote_logstream_v1_remote_logstream_proto_goTypes,
290		DependencyIndexes: file_build_bazel_remote_logstream_v1_remote_logstream_proto_depIdxs,
291		MessageInfos:      file_build_bazel_remote_logstream_v1_remote_logstream_proto_msgTypes,
292	}.Build()
293	File_build_bazel_remote_logstream_v1_remote_logstream_proto = out.File
294	file_build_bazel_remote_logstream_v1_remote_logstream_proto_rawDesc = nil
295	file_build_bazel_remote_logstream_v1_remote_logstream_proto_goTypes = nil
296	file_build_bazel_remote_logstream_v1_remote_logstream_proto_depIdxs = nil
297}
298
299// Reference imports to suppress errors if they are not otherwise used.
300var _ context.Context
301var _ grpc.ClientConnInterface
302
303// This is a compile-time assertion to ensure that this generated file
304// is compatible with the grpc package it is being compiled against.
305const _ = grpc.SupportPackageIsVersion6
306
307// LogStreamServiceClient is the client API for LogStreamService service.
308//
309// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
310type LogStreamServiceClient interface {
311	// Create a LogStream which may be written to.
312	//
313	// The returned LogStream resource name will include a `write_resource_name`
314	// which is the resource to use when writing to the LogStream.
315	// Callers of CreateLogStream are expected to NOT publish the
316	// `write_resource_name`.
317	CreateLogStream(ctx context.Context, in *CreateLogStreamRequest, opts ...grpc.CallOption) (*LogStream, error)
318}
319
320type logStreamServiceClient struct {
321	cc grpc.ClientConnInterface
322}
323
324func NewLogStreamServiceClient(cc grpc.ClientConnInterface) LogStreamServiceClient {
325	return &logStreamServiceClient{cc}
326}
327
328func (c *logStreamServiceClient) CreateLogStream(ctx context.Context, in *CreateLogStreamRequest, opts ...grpc.CallOption) (*LogStream, error) {
329	out := new(LogStream)
330	err := c.cc.Invoke(ctx, "/build.bazel.remote.logstream.v1.LogStreamService/CreateLogStream", in, out, opts...)
331	if err != nil {
332		return nil, err
333	}
334	return out, nil
335}
336
337// LogStreamServiceServer is the server API for LogStreamService service.
338type LogStreamServiceServer interface {
339	// Create a LogStream which may be written to.
340	//
341	// The returned LogStream resource name will include a `write_resource_name`
342	// which is the resource to use when writing to the LogStream.
343	// Callers of CreateLogStream are expected to NOT publish the
344	// `write_resource_name`.
345	CreateLogStream(context.Context, *CreateLogStreamRequest) (*LogStream, error)
346}
347
348// UnimplementedLogStreamServiceServer can be embedded to have forward compatible implementations.
349type UnimplementedLogStreamServiceServer struct {
350}
351
352func (*UnimplementedLogStreamServiceServer) CreateLogStream(context.Context, *CreateLogStreamRequest) (*LogStream, error) {
353	return nil, status.Errorf(codes.Unimplemented, "method CreateLogStream not implemented")
354}
355
356func RegisterLogStreamServiceServer(s *grpc.Server, srv LogStreamServiceServer) {
357	s.RegisterService(&_LogStreamService_serviceDesc, srv)
358}
359
360func _LogStreamService_CreateLogStream_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
361	in := new(CreateLogStreamRequest)
362	if err := dec(in); err != nil {
363		return nil, err
364	}
365	if interceptor == nil {
366		return srv.(LogStreamServiceServer).CreateLogStream(ctx, in)
367	}
368	info := &grpc.UnaryServerInfo{
369		Server:     srv,
370		FullMethod: "/build.bazel.remote.logstream.v1.LogStreamService/CreateLogStream",
371	}
372	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
373		return srv.(LogStreamServiceServer).CreateLogStream(ctx, req.(*CreateLogStreamRequest))
374	}
375	return interceptor(ctx, in, info, handler)
376}
377
378var _LogStreamService_serviceDesc = grpc.ServiceDesc{
379	ServiceName: "build.bazel.remote.logstream.v1.LogStreamService",
380	HandlerType: (*LogStreamServiceServer)(nil),
381	Methods: []grpc.MethodDesc{
382		{
383			MethodName: "CreateLogStream",
384			Handler:    _LogStreamService_CreateLogStream_Handler,
385		},
386	},
387	Streams:  []grpc.StreamDesc{},
388	Metadata: "build/bazel/remote/logstream/v1/remote_logstream.proto",
389}
390