Path: blob/main/components/supervisor-api/go/token_grpc.pb.go
2498 views
// Copyright (c) 2023 Gitpod GmbH. All rights reserved.1// Licensed under the GNU Affero General Public License (AGPL).2// See License.AGPL.txt in the project root for license information.34// Code generated by protoc-gen-go-grpc. DO NOT EDIT.5// versions:6// - protoc-gen-go-grpc v1.2.07// - protoc v3.20.18// source: token.proto910package api1112import (13context "context"14grpc "google.golang.org/grpc"15codes "google.golang.org/grpc/codes"16status "google.golang.org/grpc/status"17)1819// This is a compile-time assertion to ensure that this generated file20// is compatible with the grpc package it is being compiled against.21// Requires gRPC-Go v1.32.0 or later.22const _ = grpc.SupportPackageIsVersion72324// TokenServiceClient is the client API for TokenService service.25//26// 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.27type TokenServiceClient interface {28GetToken(ctx context.Context, in *GetTokenRequest, opts ...grpc.CallOption) (*GetTokenResponse, error)29SetToken(ctx context.Context, in *SetTokenRequest, opts ...grpc.CallOption) (*SetTokenResponse, error)30ClearToken(ctx context.Context, in *ClearTokenRequest, opts ...grpc.CallOption) (*ClearTokenResponse, error)31ProvideToken(ctx context.Context, opts ...grpc.CallOption) (TokenService_ProvideTokenClient, error)32}3334type tokenServiceClient struct {35cc grpc.ClientConnInterface36}3738func NewTokenServiceClient(cc grpc.ClientConnInterface) TokenServiceClient {39return &tokenServiceClient{cc}40}4142func (c *tokenServiceClient) GetToken(ctx context.Context, in *GetTokenRequest, opts ...grpc.CallOption) (*GetTokenResponse, error) {43out := new(GetTokenResponse)44err := c.cc.Invoke(ctx, "/supervisor.TokenService/GetToken", in, out, opts...)45if err != nil {46return nil, err47}48return out, nil49}5051func (c *tokenServiceClient) SetToken(ctx context.Context, in *SetTokenRequest, opts ...grpc.CallOption) (*SetTokenResponse, error) {52out := new(SetTokenResponse)53err := c.cc.Invoke(ctx, "/supervisor.TokenService/SetToken", in, out, opts...)54if err != nil {55return nil, err56}57return out, nil58}5960func (c *tokenServiceClient) ClearToken(ctx context.Context, in *ClearTokenRequest, opts ...grpc.CallOption) (*ClearTokenResponse, error) {61out := new(ClearTokenResponse)62err := c.cc.Invoke(ctx, "/supervisor.TokenService/ClearToken", in, out, opts...)63if err != nil {64return nil, err65}66return out, nil67}6869func (c *tokenServiceClient) ProvideToken(ctx context.Context, opts ...grpc.CallOption) (TokenService_ProvideTokenClient, error) {70stream, err := c.cc.NewStream(ctx, &TokenService_ServiceDesc.Streams[0], "/supervisor.TokenService/ProvideToken", opts...)71if err != nil {72return nil, err73}74x := &tokenServiceProvideTokenClient{stream}75return x, nil76}7778type TokenService_ProvideTokenClient interface {79Send(*ProvideTokenRequest) error80Recv() (*ProvideTokenResponse, error)81grpc.ClientStream82}8384type tokenServiceProvideTokenClient struct {85grpc.ClientStream86}8788func (x *tokenServiceProvideTokenClient) Send(m *ProvideTokenRequest) error {89return x.ClientStream.SendMsg(m)90}9192func (x *tokenServiceProvideTokenClient) Recv() (*ProvideTokenResponse, error) {93m := new(ProvideTokenResponse)94if err := x.ClientStream.RecvMsg(m); err != nil {95return nil, err96}97return m, nil98}99100// TokenServiceServer is the server API for TokenService service.101// All implementations must embed UnimplementedTokenServiceServer102// for forward compatibility103type TokenServiceServer interface {104GetToken(context.Context, *GetTokenRequest) (*GetTokenResponse, error)105SetToken(context.Context, *SetTokenRequest) (*SetTokenResponse, error)106ClearToken(context.Context, *ClearTokenRequest) (*ClearTokenResponse, error)107ProvideToken(TokenService_ProvideTokenServer) error108mustEmbedUnimplementedTokenServiceServer()109}110111// UnimplementedTokenServiceServer must be embedded to have forward compatible implementations.112type UnimplementedTokenServiceServer struct {113}114115func (UnimplementedTokenServiceServer) GetToken(context.Context, *GetTokenRequest) (*GetTokenResponse, error) {116return nil, status.Errorf(codes.Unimplemented, "method GetToken not implemented")117}118func (UnimplementedTokenServiceServer) SetToken(context.Context, *SetTokenRequest) (*SetTokenResponse, error) {119return nil, status.Errorf(codes.Unimplemented, "method SetToken not implemented")120}121func (UnimplementedTokenServiceServer) ClearToken(context.Context, *ClearTokenRequest) (*ClearTokenResponse, error) {122return nil, status.Errorf(codes.Unimplemented, "method ClearToken not implemented")123}124func (UnimplementedTokenServiceServer) ProvideToken(TokenService_ProvideTokenServer) error {125return status.Errorf(codes.Unimplemented, "method ProvideToken not implemented")126}127func (UnimplementedTokenServiceServer) mustEmbedUnimplementedTokenServiceServer() {}128129// UnsafeTokenServiceServer may be embedded to opt out of forward compatibility for this service.130// Use of this interface is not recommended, as added methods to TokenServiceServer will131// result in compilation errors.132type UnsafeTokenServiceServer interface {133mustEmbedUnimplementedTokenServiceServer()134}135136func RegisterTokenServiceServer(s grpc.ServiceRegistrar, srv TokenServiceServer) {137s.RegisterService(&TokenService_ServiceDesc, srv)138}139140func _TokenService_GetToken_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {141in := new(GetTokenRequest)142if err := dec(in); err != nil {143return nil, err144}145if interceptor == nil {146return srv.(TokenServiceServer).GetToken(ctx, in)147}148info := &grpc.UnaryServerInfo{149Server: srv,150FullMethod: "/supervisor.TokenService/GetToken",151}152handler := func(ctx context.Context, req interface{}) (interface{}, error) {153return srv.(TokenServiceServer).GetToken(ctx, req.(*GetTokenRequest))154}155return interceptor(ctx, in, info, handler)156}157158func _TokenService_SetToken_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {159in := new(SetTokenRequest)160if err := dec(in); err != nil {161return nil, err162}163if interceptor == nil {164return srv.(TokenServiceServer).SetToken(ctx, in)165}166info := &grpc.UnaryServerInfo{167Server: srv,168FullMethod: "/supervisor.TokenService/SetToken",169}170handler := func(ctx context.Context, req interface{}) (interface{}, error) {171return srv.(TokenServiceServer).SetToken(ctx, req.(*SetTokenRequest))172}173return interceptor(ctx, in, info, handler)174}175176func _TokenService_ClearToken_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {177in := new(ClearTokenRequest)178if err := dec(in); err != nil {179return nil, err180}181if interceptor == nil {182return srv.(TokenServiceServer).ClearToken(ctx, in)183}184info := &grpc.UnaryServerInfo{185Server: srv,186FullMethod: "/supervisor.TokenService/ClearToken",187}188handler := func(ctx context.Context, req interface{}) (interface{}, error) {189return srv.(TokenServiceServer).ClearToken(ctx, req.(*ClearTokenRequest))190}191return interceptor(ctx, in, info, handler)192}193194func _TokenService_ProvideToken_Handler(srv interface{}, stream grpc.ServerStream) error {195return srv.(TokenServiceServer).ProvideToken(&tokenServiceProvideTokenServer{stream})196}197198type TokenService_ProvideTokenServer interface {199Send(*ProvideTokenResponse) error200Recv() (*ProvideTokenRequest, error)201grpc.ServerStream202}203204type tokenServiceProvideTokenServer struct {205grpc.ServerStream206}207208func (x *tokenServiceProvideTokenServer) Send(m *ProvideTokenResponse) error {209return x.ServerStream.SendMsg(m)210}211212func (x *tokenServiceProvideTokenServer) Recv() (*ProvideTokenRequest, error) {213m := new(ProvideTokenRequest)214if err := x.ServerStream.RecvMsg(m); err != nil {215return nil, err216}217return m, nil218}219220// TokenService_ServiceDesc is the grpc.ServiceDesc for TokenService service.221// It's only intended for direct use with grpc.RegisterService,222// and not to be introspected or modified (even as a copy)223var TokenService_ServiceDesc = grpc.ServiceDesc{224ServiceName: "supervisor.TokenService",225HandlerType: (*TokenServiceServer)(nil),226Methods: []grpc.MethodDesc{227{228MethodName: "GetToken",229Handler: _TokenService_GetToken_Handler,230},231{232MethodName: "SetToken",233Handler: _TokenService_SetToken_Handler,234},235{236MethodName: "ClearToken",237Handler: _TokenService_ClearToken_Handler,238},239},240Streams: []grpc.StreamDesc{241{242StreamName: "ProvideToken",243Handler: _TokenService_ProvideToken_Handler,244ServerStreams: true,245ClientStreams: true,246},247},248Metadata: "token.proto",249}250251252