go.chromium.org/luci@v0.0.0-20240309015107-7cdc2e660f33/config_service/proto/config_service_grpc.pb.go (about) 1 // Copyright 2023 The LUCI Authors. All rights reserved. 2 // Use of this source code is governed under the Apache License, Version 2.0 3 // that can be found in the LICENSE file. 4 5 // Code generated by protoc-gen-go-grpc. DO NOT EDIT. 6 // versions: 7 // - protoc-gen-go-grpc v1.3.0 8 // - protoc v3.21.7 9 // source: go.chromium.org/luci/config_service/proto/config_service.proto 10 11 package configpb 12 13 import ( 14 context "context" 15 config "go.chromium.org/luci/common/proto/config" 16 grpc "google.golang.org/grpc" 17 codes "google.golang.org/grpc/codes" 18 status "google.golang.org/grpc/status" 19 ) 20 21 // This is a compile-time assertion to ensure that this generated file 22 // is compatible with the grpc package it is being compiled against. 23 // Requires gRPC-Go v1.32.0 or later. 24 const _ = grpc.SupportPackageIsVersion7 25 26 const ( 27 Configs_GetConfig_FullMethodName = "/config.service.v2.Configs/GetConfig" 28 Configs_GetProjectConfigs_FullMethodName = "/config.service.v2.Configs/GetProjectConfigs" 29 Configs_ListConfigSets_FullMethodName = "/config.service.v2.Configs/ListConfigSets" 30 Configs_GetConfigSet_FullMethodName = "/config.service.v2.Configs/GetConfigSet" 31 Configs_ValidateConfigs_FullMethodName = "/config.service.v2.Configs/ValidateConfigs" 32 ) 33 34 // ConfigsClient is the client API for Configs service. 35 // 36 // 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. 37 type ConfigsClient interface { 38 // Get one configuration. 39 GetConfig(ctx context.Context, in *GetConfigRequest, opts ...grpc.CallOption) (*Config, error) 40 // Get the specified project configs from all projects. 41 GetProjectConfigs(ctx context.Context, in *GetProjectConfigsRequest, opts ...grpc.CallOption) (*GetProjectConfigsResponse, error) 42 // List config sets. 43 ListConfigSets(ctx context.Context, in *ListConfigSetsRequest, opts ...grpc.CallOption) (*ListConfigSetsResponse, error) 44 // Get a single config set. 45 GetConfigSet(ctx context.Context, in *GetConfigSetRequest, opts ...grpc.CallOption) (*ConfigSet, error) 46 // Validates configs for a config set. 47 // 48 // The validation workflow works as follows (assuming first time validation): 49 // 1. Client sends the manifest of the config directory for validation. The 50 // manifest consists of the relative posix style path to each config file 51 // and the SHA256 hash of the content of each config file. 52 // 2. Server returns grpc error status with InvalidArgument code and 53 // a `BadValidationRequestFixInfo` message in status_detail. 54 // `BadValidationRequestFixInfo` should contain a signed url for each 55 // config file and Client is responsible to upload the *gzip compressed* 56 // config to the url. Client should also fix any remaining error mentioned 57 // in `BadValidationRequestFixInfo`. Note that, if the request contains 58 // any invalid argument like malformed config set or absolute file path, 59 // LUCI Config will only return the grpc error status with InvalidArgument 60 // code but without anything in status_details because those type of errors 61 // are not fixable. 62 // 3. Call the server again with the same validation request as in step 1. The 63 // Server should be able to perform the validation and return the 64 // result. 65 // 4. Repeat step 1-3 for any subsequent validation request. Note that for 66 // step 2, the Server would only ask client to upload files that it has 67 // not seen their hashes in any previous validation session (for up to 1 68 // day). 69 ValidateConfigs(ctx context.Context, in *ValidateConfigsRequest, opts ...grpc.CallOption) (*config.ValidationResult, error) 70 } 71 72 type configsClient struct { 73 cc grpc.ClientConnInterface 74 } 75 76 func NewConfigsClient(cc grpc.ClientConnInterface) ConfigsClient { 77 return &configsClient{cc} 78 } 79 80 func (c *configsClient) GetConfig(ctx context.Context, in *GetConfigRequest, opts ...grpc.CallOption) (*Config, error) { 81 out := new(Config) 82 err := c.cc.Invoke(ctx, Configs_GetConfig_FullMethodName, in, out, opts...) 83 if err != nil { 84 return nil, err 85 } 86 return out, nil 87 } 88 89 func (c *configsClient) GetProjectConfigs(ctx context.Context, in *GetProjectConfigsRequest, opts ...grpc.CallOption) (*GetProjectConfigsResponse, error) { 90 out := new(GetProjectConfigsResponse) 91 err := c.cc.Invoke(ctx, Configs_GetProjectConfigs_FullMethodName, in, out, opts...) 92 if err != nil { 93 return nil, err 94 } 95 return out, nil 96 } 97 98 func (c *configsClient) ListConfigSets(ctx context.Context, in *ListConfigSetsRequest, opts ...grpc.CallOption) (*ListConfigSetsResponse, error) { 99 out := new(ListConfigSetsResponse) 100 err := c.cc.Invoke(ctx, Configs_ListConfigSets_FullMethodName, in, out, opts...) 101 if err != nil { 102 return nil, err 103 } 104 return out, nil 105 } 106 107 func (c *configsClient) GetConfigSet(ctx context.Context, in *GetConfigSetRequest, opts ...grpc.CallOption) (*ConfigSet, error) { 108 out := new(ConfigSet) 109 err := c.cc.Invoke(ctx, Configs_GetConfigSet_FullMethodName, in, out, opts...) 110 if err != nil { 111 return nil, err 112 } 113 return out, nil 114 } 115 116 func (c *configsClient) ValidateConfigs(ctx context.Context, in *ValidateConfigsRequest, opts ...grpc.CallOption) (*config.ValidationResult, error) { 117 out := new(config.ValidationResult) 118 err := c.cc.Invoke(ctx, Configs_ValidateConfigs_FullMethodName, in, out, opts...) 119 if err != nil { 120 return nil, err 121 } 122 return out, nil 123 } 124 125 // ConfigsServer is the server API for Configs service. 126 // All implementations must embed UnimplementedConfigsServer 127 // for forward compatibility 128 type ConfigsServer interface { 129 // Get one configuration. 130 GetConfig(context.Context, *GetConfigRequest) (*Config, error) 131 // Get the specified project configs from all projects. 132 GetProjectConfigs(context.Context, *GetProjectConfigsRequest) (*GetProjectConfigsResponse, error) 133 // List config sets. 134 ListConfigSets(context.Context, *ListConfigSetsRequest) (*ListConfigSetsResponse, error) 135 // Get a single config set. 136 GetConfigSet(context.Context, *GetConfigSetRequest) (*ConfigSet, error) 137 // Validates configs for a config set. 138 // 139 // The validation workflow works as follows (assuming first time validation): 140 // 1. Client sends the manifest of the config directory for validation. The 141 // manifest consists of the relative posix style path to each config file 142 // and the SHA256 hash of the content of each config file. 143 // 2. Server returns grpc error status with InvalidArgument code and 144 // a `BadValidationRequestFixInfo` message in status_detail. 145 // `BadValidationRequestFixInfo` should contain a signed url for each 146 // config file and Client is responsible to upload the *gzip compressed* 147 // config to the url. Client should also fix any remaining error mentioned 148 // in `BadValidationRequestFixInfo`. Note that, if the request contains 149 // any invalid argument like malformed config set or absolute file path, 150 // LUCI Config will only return the grpc error status with InvalidArgument 151 // code but without anything in status_details because those type of errors 152 // are not fixable. 153 // 3. Call the server again with the same validation request as in step 1. The 154 // Server should be able to perform the validation and return the 155 // result. 156 // 4. Repeat step 1-3 for any subsequent validation request. Note that for 157 // step 2, the Server would only ask client to upload files that it has 158 // not seen their hashes in any previous validation session (for up to 1 159 // day). 160 ValidateConfigs(context.Context, *ValidateConfigsRequest) (*config.ValidationResult, error) 161 mustEmbedUnimplementedConfigsServer() 162 } 163 164 // UnimplementedConfigsServer must be embedded to have forward compatible implementations. 165 type UnimplementedConfigsServer struct { 166 } 167 168 func (UnimplementedConfigsServer) GetConfig(context.Context, *GetConfigRequest) (*Config, error) { 169 return nil, status.Errorf(codes.Unimplemented, "method GetConfig not implemented") 170 } 171 func (UnimplementedConfigsServer) GetProjectConfigs(context.Context, *GetProjectConfigsRequest) (*GetProjectConfigsResponse, error) { 172 return nil, status.Errorf(codes.Unimplemented, "method GetProjectConfigs not implemented") 173 } 174 func (UnimplementedConfigsServer) ListConfigSets(context.Context, *ListConfigSetsRequest) (*ListConfigSetsResponse, error) { 175 return nil, status.Errorf(codes.Unimplemented, "method ListConfigSets not implemented") 176 } 177 func (UnimplementedConfigsServer) GetConfigSet(context.Context, *GetConfigSetRequest) (*ConfigSet, error) { 178 return nil, status.Errorf(codes.Unimplemented, "method GetConfigSet not implemented") 179 } 180 func (UnimplementedConfigsServer) ValidateConfigs(context.Context, *ValidateConfigsRequest) (*config.ValidationResult, error) { 181 return nil, status.Errorf(codes.Unimplemented, "method ValidateConfigs not implemented") 182 } 183 func (UnimplementedConfigsServer) mustEmbedUnimplementedConfigsServer() {} 184 185 // UnsafeConfigsServer may be embedded to opt out of forward compatibility for this service. 186 // Use of this interface is not recommended, as added methods to ConfigsServer will 187 // result in compilation errors. 188 type UnsafeConfigsServer interface { 189 mustEmbedUnimplementedConfigsServer() 190 } 191 192 func RegisterConfigsServer(s grpc.ServiceRegistrar, srv ConfigsServer) { 193 s.RegisterService(&Configs_ServiceDesc, srv) 194 } 195 196 func _Configs_GetConfig_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 197 in := new(GetConfigRequest) 198 if err := dec(in); err != nil { 199 return nil, err 200 } 201 if interceptor == nil { 202 return srv.(ConfigsServer).GetConfig(ctx, in) 203 } 204 info := &grpc.UnaryServerInfo{ 205 Server: srv, 206 FullMethod: Configs_GetConfig_FullMethodName, 207 } 208 handler := func(ctx context.Context, req interface{}) (interface{}, error) { 209 return srv.(ConfigsServer).GetConfig(ctx, req.(*GetConfigRequest)) 210 } 211 return interceptor(ctx, in, info, handler) 212 } 213 214 func _Configs_GetProjectConfigs_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 215 in := new(GetProjectConfigsRequest) 216 if err := dec(in); err != nil { 217 return nil, err 218 } 219 if interceptor == nil { 220 return srv.(ConfigsServer).GetProjectConfigs(ctx, in) 221 } 222 info := &grpc.UnaryServerInfo{ 223 Server: srv, 224 FullMethod: Configs_GetProjectConfigs_FullMethodName, 225 } 226 handler := func(ctx context.Context, req interface{}) (interface{}, error) { 227 return srv.(ConfigsServer).GetProjectConfigs(ctx, req.(*GetProjectConfigsRequest)) 228 } 229 return interceptor(ctx, in, info, handler) 230 } 231 232 func _Configs_ListConfigSets_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 233 in := new(ListConfigSetsRequest) 234 if err := dec(in); err != nil { 235 return nil, err 236 } 237 if interceptor == nil { 238 return srv.(ConfigsServer).ListConfigSets(ctx, in) 239 } 240 info := &grpc.UnaryServerInfo{ 241 Server: srv, 242 FullMethod: Configs_ListConfigSets_FullMethodName, 243 } 244 handler := func(ctx context.Context, req interface{}) (interface{}, error) { 245 return srv.(ConfigsServer).ListConfigSets(ctx, req.(*ListConfigSetsRequest)) 246 } 247 return interceptor(ctx, in, info, handler) 248 } 249 250 func _Configs_GetConfigSet_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 251 in := new(GetConfigSetRequest) 252 if err := dec(in); err != nil { 253 return nil, err 254 } 255 if interceptor == nil { 256 return srv.(ConfigsServer).GetConfigSet(ctx, in) 257 } 258 info := &grpc.UnaryServerInfo{ 259 Server: srv, 260 FullMethod: Configs_GetConfigSet_FullMethodName, 261 } 262 handler := func(ctx context.Context, req interface{}) (interface{}, error) { 263 return srv.(ConfigsServer).GetConfigSet(ctx, req.(*GetConfigSetRequest)) 264 } 265 return interceptor(ctx, in, info, handler) 266 } 267 268 func _Configs_ValidateConfigs_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 269 in := new(ValidateConfigsRequest) 270 if err := dec(in); err != nil { 271 return nil, err 272 } 273 if interceptor == nil { 274 return srv.(ConfigsServer).ValidateConfigs(ctx, in) 275 } 276 info := &grpc.UnaryServerInfo{ 277 Server: srv, 278 FullMethod: Configs_ValidateConfigs_FullMethodName, 279 } 280 handler := func(ctx context.Context, req interface{}) (interface{}, error) { 281 return srv.(ConfigsServer).ValidateConfigs(ctx, req.(*ValidateConfigsRequest)) 282 } 283 return interceptor(ctx, in, info, handler) 284 } 285 286 // Configs_ServiceDesc is the grpc.ServiceDesc for Configs service. 287 // It's only intended for direct use with grpc.RegisterService, 288 // and not to be introspected or modified (even as a copy) 289 var Configs_ServiceDesc = grpc.ServiceDesc{ 290 ServiceName: "config.service.v2.Configs", 291 HandlerType: (*ConfigsServer)(nil), 292 Methods: []grpc.MethodDesc{ 293 { 294 MethodName: "GetConfig", 295 Handler: _Configs_GetConfig_Handler, 296 }, 297 { 298 MethodName: "GetProjectConfigs", 299 Handler: _Configs_GetProjectConfigs_Handler, 300 }, 301 { 302 MethodName: "ListConfigSets", 303 Handler: _Configs_ListConfigSets_Handler, 304 }, 305 { 306 MethodName: "GetConfigSet", 307 Handler: _Configs_GetConfigSet_Handler, 308 }, 309 { 310 MethodName: "ValidateConfigs", 311 Handler: _Configs_ValidateConfigs_Handler, 312 }, 313 }, 314 Streams: []grpc.StreamDesc{}, 315 Metadata: "go.chromium.org/luci/config_service/proto/config_service.proto", 316 }