go.chromium.org/luci@v0.0.0-20240309015107-7cdc2e660f33/provenance/api/snooperpb/v1/report_grpc.pb.go (about)

     1  // Copyright 2022 The LUCI 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  // Code generated by protoc-gen-go-grpc. DO NOT EDIT.
    16  // versions:
    17  // - protoc-gen-go-grpc v1.3.0
    18  // - protoc             v3.21.7
    19  // source: go.chromium.org/luci/provenance/api/snooperpb/v1/report.proto
    20  
    21  package snooperpb
    22  
    23  import (
    24  	context "context"
    25  	grpc "google.golang.org/grpc"
    26  	codes "google.golang.org/grpc/codes"
    27  	status "google.golang.org/grpc/status"
    28  	emptypb "google.golang.org/protobuf/types/known/emptypb"
    29  )
    30  
    31  // This is a compile-time assertion to ensure that this generated file
    32  // is compatible with the grpc package it is being compiled against.
    33  // Requires gRPC-Go v1.32.0 or later.
    34  const _ = grpc.SupportPackageIsVersion7
    35  
    36  const (
    37  	SelfReport_ReportCipd_FullMethodName           = "/provenance.snooperpb.SelfReport/ReportCipd"
    38  	SelfReport_ReportGit_FullMethodName            = "/provenance.snooperpb.SelfReport/ReportGit"
    39  	SelfReport_ReportGcs_FullMethodName            = "/provenance.snooperpb.SelfReport/ReportGcs"
    40  	SelfReport_ReportTaskStage_FullMethodName      = "/provenance.snooperpb.SelfReport/ReportTaskStage"
    41  	SelfReport_ReportPID_FullMethodName            = "/provenance.snooperpb.SelfReport/ReportPID"
    42  	SelfReport_ReportArtifactDigest_FullMethodName = "/provenance.snooperpb.SelfReport/ReportArtifactDigest"
    43  )
    44  
    45  // SelfReportClient is the client API for SelfReport service.
    46  //
    47  // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
    48  type SelfReportClient interface {
    49  	// Interface to report cipd packages admitted on the local machine.
    50  	ReportCipd(ctx context.Context, in *ReportCipdRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
    51  	// Interface to report git repos checked out on the local machine.
    52  	ReportGit(ctx context.Context, in *ReportGitRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
    53  	// Interface to report gcs artifacts downloaded on a local machine.
    54  	ReportGcs(ctx context.Context, in *ReportGcsRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
    55  	// Reports running task's stage. A task is typically a collection of
    56  	// workflows/statements. Some of these statements can be grouped together
    57  	// to define a stage, e.g. when a task is downloading sources/deps, it is
    58  	// known as `FETCH` stage.
    59  	// For details read go/snoopy-design (Google-internal).
    60  	ReportTaskStage(ctx context.Context, in *ReportTaskStageRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
    61  	// Reports a PID to track execution of the process. When implementing the
    62  	// provenance server ensure safeguards to the end point with strict input
    63  	// validation.
    64  	ReportPID(ctx context.Context, in *ReportPIDRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
    65  	// Reports digest of produced artifact from a task.
    66  	ReportArtifactDigest(ctx context.Context, in *ReportArtifactDigestRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
    67  }
    68  
    69  type selfReportClient struct {
    70  	cc grpc.ClientConnInterface
    71  }
    72  
    73  func NewSelfReportClient(cc grpc.ClientConnInterface) SelfReportClient {
    74  	return &selfReportClient{cc}
    75  }
    76  
    77  func (c *selfReportClient) ReportCipd(ctx context.Context, in *ReportCipdRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
    78  	out := new(emptypb.Empty)
    79  	err := c.cc.Invoke(ctx, SelfReport_ReportCipd_FullMethodName, in, out, opts...)
    80  	if err != nil {
    81  		return nil, err
    82  	}
    83  	return out, nil
    84  }
    85  
    86  func (c *selfReportClient) ReportGit(ctx context.Context, in *ReportGitRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
    87  	out := new(emptypb.Empty)
    88  	err := c.cc.Invoke(ctx, SelfReport_ReportGit_FullMethodName, in, out, opts...)
    89  	if err != nil {
    90  		return nil, err
    91  	}
    92  	return out, nil
    93  }
    94  
    95  func (c *selfReportClient) ReportGcs(ctx context.Context, in *ReportGcsRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
    96  	out := new(emptypb.Empty)
    97  	err := c.cc.Invoke(ctx, SelfReport_ReportGcs_FullMethodName, in, out, opts...)
    98  	if err != nil {
    99  		return nil, err
   100  	}
   101  	return out, nil
   102  }
   103  
   104  func (c *selfReportClient) ReportTaskStage(ctx context.Context, in *ReportTaskStageRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
   105  	out := new(emptypb.Empty)
   106  	err := c.cc.Invoke(ctx, SelfReport_ReportTaskStage_FullMethodName, in, out, opts...)
   107  	if err != nil {
   108  		return nil, err
   109  	}
   110  	return out, nil
   111  }
   112  
   113  func (c *selfReportClient) ReportPID(ctx context.Context, in *ReportPIDRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
   114  	out := new(emptypb.Empty)
   115  	err := c.cc.Invoke(ctx, SelfReport_ReportPID_FullMethodName, in, out, opts...)
   116  	if err != nil {
   117  		return nil, err
   118  	}
   119  	return out, nil
   120  }
   121  
   122  func (c *selfReportClient) ReportArtifactDigest(ctx context.Context, in *ReportArtifactDigestRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
   123  	out := new(emptypb.Empty)
   124  	err := c.cc.Invoke(ctx, SelfReport_ReportArtifactDigest_FullMethodName, in, out, opts...)
   125  	if err != nil {
   126  		return nil, err
   127  	}
   128  	return out, nil
   129  }
   130  
   131  // SelfReportServer is the server API for SelfReport service.
   132  // All implementations must embed UnimplementedSelfReportServer
   133  // for forward compatibility
   134  type SelfReportServer interface {
   135  	// Interface to report cipd packages admitted on the local machine.
   136  	ReportCipd(context.Context, *ReportCipdRequest) (*emptypb.Empty, error)
   137  	// Interface to report git repos checked out on the local machine.
   138  	ReportGit(context.Context, *ReportGitRequest) (*emptypb.Empty, error)
   139  	// Interface to report gcs artifacts downloaded on a local machine.
   140  	ReportGcs(context.Context, *ReportGcsRequest) (*emptypb.Empty, error)
   141  	// Reports running task's stage. A task is typically a collection of
   142  	// workflows/statements. Some of these statements can be grouped together
   143  	// to define a stage, e.g. when a task is downloading sources/deps, it is
   144  	// known as `FETCH` stage.
   145  	// For details read go/snoopy-design (Google-internal).
   146  	ReportTaskStage(context.Context, *ReportTaskStageRequest) (*emptypb.Empty, error)
   147  	// Reports a PID to track execution of the process. When implementing the
   148  	// provenance server ensure safeguards to the end point with strict input
   149  	// validation.
   150  	ReportPID(context.Context, *ReportPIDRequest) (*emptypb.Empty, error)
   151  	// Reports digest of produced artifact from a task.
   152  	ReportArtifactDigest(context.Context, *ReportArtifactDigestRequest) (*emptypb.Empty, error)
   153  	mustEmbedUnimplementedSelfReportServer()
   154  }
   155  
   156  // UnimplementedSelfReportServer must be embedded to have forward compatible implementations.
   157  type UnimplementedSelfReportServer struct {
   158  }
   159  
   160  func (UnimplementedSelfReportServer) ReportCipd(context.Context, *ReportCipdRequest) (*emptypb.Empty, error) {
   161  	return nil, status.Errorf(codes.Unimplemented, "method ReportCipd not implemented")
   162  }
   163  func (UnimplementedSelfReportServer) ReportGit(context.Context, *ReportGitRequest) (*emptypb.Empty, error) {
   164  	return nil, status.Errorf(codes.Unimplemented, "method ReportGit not implemented")
   165  }
   166  func (UnimplementedSelfReportServer) ReportGcs(context.Context, *ReportGcsRequest) (*emptypb.Empty, error) {
   167  	return nil, status.Errorf(codes.Unimplemented, "method ReportGcs not implemented")
   168  }
   169  func (UnimplementedSelfReportServer) ReportTaskStage(context.Context, *ReportTaskStageRequest) (*emptypb.Empty, error) {
   170  	return nil, status.Errorf(codes.Unimplemented, "method ReportTaskStage not implemented")
   171  }
   172  func (UnimplementedSelfReportServer) ReportPID(context.Context, *ReportPIDRequest) (*emptypb.Empty, error) {
   173  	return nil, status.Errorf(codes.Unimplemented, "method ReportPID not implemented")
   174  }
   175  func (UnimplementedSelfReportServer) ReportArtifactDigest(context.Context, *ReportArtifactDigestRequest) (*emptypb.Empty, error) {
   176  	return nil, status.Errorf(codes.Unimplemented, "method ReportArtifactDigest not implemented")
   177  }
   178  func (UnimplementedSelfReportServer) mustEmbedUnimplementedSelfReportServer() {}
   179  
   180  // UnsafeSelfReportServer may be embedded to opt out of forward compatibility for this service.
   181  // Use of this interface is not recommended, as added methods to SelfReportServer will
   182  // result in compilation errors.
   183  type UnsafeSelfReportServer interface {
   184  	mustEmbedUnimplementedSelfReportServer()
   185  }
   186  
   187  func RegisterSelfReportServer(s grpc.ServiceRegistrar, srv SelfReportServer) {
   188  	s.RegisterService(&SelfReport_ServiceDesc, srv)
   189  }
   190  
   191  func _SelfReport_ReportCipd_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   192  	in := new(ReportCipdRequest)
   193  	if err := dec(in); err != nil {
   194  		return nil, err
   195  	}
   196  	if interceptor == nil {
   197  		return srv.(SelfReportServer).ReportCipd(ctx, in)
   198  	}
   199  	info := &grpc.UnaryServerInfo{
   200  		Server:     srv,
   201  		FullMethod: SelfReport_ReportCipd_FullMethodName,
   202  	}
   203  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   204  		return srv.(SelfReportServer).ReportCipd(ctx, req.(*ReportCipdRequest))
   205  	}
   206  	return interceptor(ctx, in, info, handler)
   207  }
   208  
   209  func _SelfReport_ReportGit_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   210  	in := new(ReportGitRequest)
   211  	if err := dec(in); err != nil {
   212  		return nil, err
   213  	}
   214  	if interceptor == nil {
   215  		return srv.(SelfReportServer).ReportGit(ctx, in)
   216  	}
   217  	info := &grpc.UnaryServerInfo{
   218  		Server:     srv,
   219  		FullMethod: SelfReport_ReportGit_FullMethodName,
   220  	}
   221  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   222  		return srv.(SelfReportServer).ReportGit(ctx, req.(*ReportGitRequest))
   223  	}
   224  	return interceptor(ctx, in, info, handler)
   225  }
   226  
   227  func _SelfReport_ReportGcs_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   228  	in := new(ReportGcsRequest)
   229  	if err := dec(in); err != nil {
   230  		return nil, err
   231  	}
   232  	if interceptor == nil {
   233  		return srv.(SelfReportServer).ReportGcs(ctx, in)
   234  	}
   235  	info := &grpc.UnaryServerInfo{
   236  		Server:     srv,
   237  		FullMethod: SelfReport_ReportGcs_FullMethodName,
   238  	}
   239  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   240  		return srv.(SelfReportServer).ReportGcs(ctx, req.(*ReportGcsRequest))
   241  	}
   242  	return interceptor(ctx, in, info, handler)
   243  }
   244  
   245  func _SelfReport_ReportTaskStage_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   246  	in := new(ReportTaskStageRequest)
   247  	if err := dec(in); err != nil {
   248  		return nil, err
   249  	}
   250  	if interceptor == nil {
   251  		return srv.(SelfReportServer).ReportTaskStage(ctx, in)
   252  	}
   253  	info := &grpc.UnaryServerInfo{
   254  		Server:     srv,
   255  		FullMethod: SelfReport_ReportTaskStage_FullMethodName,
   256  	}
   257  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   258  		return srv.(SelfReportServer).ReportTaskStage(ctx, req.(*ReportTaskStageRequest))
   259  	}
   260  	return interceptor(ctx, in, info, handler)
   261  }
   262  
   263  func _SelfReport_ReportPID_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   264  	in := new(ReportPIDRequest)
   265  	if err := dec(in); err != nil {
   266  		return nil, err
   267  	}
   268  	if interceptor == nil {
   269  		return srv.(SelfReportServer).ReportPID(ctx, in)
   270  	}
   271  	info := &grpc.UnaryServerInfo{
   272  		Server:     srv,
   273  		FullMethod: SelfReport_ReportPID_FullMethodName,
   274  	}
   275  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   276  		return srv.(SelfReportServer).ReportPID(ctx, req.(*ReportPIDRequest))
   277  	}
   278  	return interceptor(ctx, in, info, handler)
   279  }
   280  
   281  func _SelfReport_ReportArtifactDigest_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   282  	in := new(ReportArtifactDigestRequest)
   283  	if err := dec(in); err != nil {
   284  		return nil, err
   285  	}
   286  	if interceptor == nil {
   287  		return srv.(SelfReportServer).ReportArtifactDigest(ctx, in)
   288  	}
   289  	info := &grpc.UnaryServerInfo{
   290  		Server:     srv,
   291  		FullMethod: SelfReport_ReportArtifactDigest_FullMethodName,
   292  	}
   293  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   294  		return srv.(SelfReportServer).ReportArtifactDigest(ctx, req.(*ReportArtifactDigestRequest))
   295  	}
   296  	return interceptor(ctx, in, info, handler)
   297  }
   298  
   299  // SelfReport_ServiceDesc is the grpc.ServiceDesc for SelfReport service.
   300  // It's only intended for direct use with grpc.RegisterService,
   301  // and not to be introspected or modified (even as a copy)
   302  var SelfReport_ServiceDesc = grpc.ServiceDesc{
   303  	ServiceName: "provenance.snooperpb.SelfReport",
   304  	HandlerType: (*SelfReportServer)(nil),
   305  	Methods: []grpc.MethodDesc{
   306  		{
   307  			MethodName: "ReportCipd",
   308  			Handler:    _SelfReport_ReportCipd_Handler,
   309  		},
   310  		{
   311  			MethodName: "ReportGit",
   312  			Handler:    _SelfReport_ReportGit_Handler,
   313  		},
   314  		{
   315  			MethodName: "ReportGcs",
   316  			Handler:    _SelfReport_ReportGcs_Handler,
   317  		},
   318  		{
   319  			MethodName: "ReportTaskStage",
   320  			Handler:    _SelfReport_ReportTaskStage_Handler,
   321  		},
   322  		{
   323  			MethodName: "ReportPID",
   324  			Handler:    _SelfReport_ReportPID_Handler,
   325  		},
   326  		{
   327  			MethodName: "ReportArtifactDigest",
   328  			Handler:    _SelfReport_ReportArtifactDigest_Handler,
   329  		},
   330  	},
   331  	Streams:  []grpc.StreamDesc{},
   332  	Metadata: "go.chromium.org/luci/provenance/api/snooperpb/v1/report.proto",
   333  }