...

Source file src/github.com/google/s2a-go/internal/proto/v2/s2a_go_proto/s2a_grpc.pb.go

Documentation: github.com/google/s2a-go/internal/proto/v2/s2a_go_proto

     1  // Copyright 2022 Google LLC
     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  //    https://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.12
    19  // source: internal/proto/v2/s2a/s2a.proto
    20  
    21  package s2a_go_proto
    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  )
    29  
    30  // This is a compile-time assertion to ensure that this generated file
    31  // is compatible with the grpc package it is being compiled against.
    32  // Requires gRPC-Go v1.32.0 or later.
    33  const _ = grpc.SupportPackageIsVersion7
    34  
    35  const (
    36  	S2AService_SetUpSession_FullMethodName = "/s2a.proto.v2.S2AService/SetUpSession"
    37  )
    38  
    39  // S2AServiceClient is the client API for S2AService service.
    40  //
    41  // 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.
    42  type S2AServiceClient interface {
    43  	// SetUpSession is a bidirectional stream used by applications to offload
    44  	// operations from the TLS handshake.
    45  	SetUpSession(ctx context.Context, opts ...grpc.CallOption) (S2AService_SetUpSessionClient, error)
    46  }
    47  
    48  type s2AServiceClient struct {
    49  	cc grpc.ClientConnInterface
    50  }
    51  
    52  func NewS2AServiceClient(cc grpc.ClientConnInterface) S2AServiceClient {
    53  	return &s2AServiceClient{cc}
    54  }
    55  
    56  func (c *s2AServiceClient) SetUpSession(ctx context.Context, opts ...grpc.CallOption) (S2AService_SetUpSessionClient, error) {
    57  	stream, err := c.cc.NewStream(ctx, &S2AService_ServiceDesc.Streams[0], S2AService_SetUpSession_FullMethodName, opts...)
    58  	if err != nil {
    59  		return nil, err
    60  	}
    61  	x := &s2AServiceSetUpSessionClient{stream}
    62  	return x, nil
    63  }
    64  
    65  type S2AService_SetUpSessionClient interface {
    66  	Send(*SessionReq) error
    67  	Recv() (*SessionResp, error)
    68  	grpc.ClientStream
    69  }
    70  
    71  type s2AServiceSetUpSessionClient struct {
    72  	grpc.ClientStream
    73  }
    74  
    75  func (x *s2AServiceSetUpSessionClient) Send(m *SessionReq) error {
    76  	return x.ClientStream.SendMsg(m)
    77  }
    78  
    79  func (x *s2AServiceSetUpSessionClient) Recv() (*SessionResp, error) {
    80  	m := new(SessionResp)
    81  	if err := x.ClientStream.RecvMsg(m); err != nil {
    82  		return nil, err
    83  	}
    84  	return m, nil
    85  }
    86  
    87  // S2AServiceServer is the server API for S2AService service.
    88  // All implementations must embed UnimplementedS2AServiceServer
    89  // for forward compatibility
    90  type S2AServiceServer interface {
    91  	// SetUpSession is a bidirectional stream used by applications to offload
    92  	// operations from the TLS handshake.
    93  	SetUpSession(S2AService_SetUpSessionServer) error
    94  	mustEmbedUnimplementedS2AServiceServer()
    95  }
    96  
    97  // UnimplementedS2AServiceServer must be embedded to have forward compatible implementations.
    98  type UnimplementedS2AServiceServer struct {
    99  }
   100  
   101  func (UnimplementedS2AServiceServer) SetUpSession(S2AService_SetUpSessionServer) error {
   102  	return status.Errorf(codes.Unimplemented, "method SetUpSession not implemented")
   103  }
   104  func (UnimplementedS2AServiceServer) mustEmbedUnimplementedS2AServiceServer() {}
   105  
   106  // UnsafeS2AServiceServer may be embedded to opt out of forward compatibility for this service.
   107  // Use of this interface is not recommended, as added methods to S2AServiceServer will
   108  // result in compilation errors.
   109  type UnsafeS2AServiceServer interface {
   110  	mustEmbedUnimplementedS2AServiceServer()
   111  }
   112  
   113  func RegisterS2AServiceServer(s grpc.ServiceRegistrar, srv S2AServiceServer) {
   114  	s.RegisterService(&S2AService_ServiceDesc, srv)
   115  }
   116  
   117  func _S2AService_SetUpSession_Handler(srv interface{}, stream grpc.ServerStream) error {
   118  	return srv.(S2AServiceServer).SetUpSession(&s2AServiceSetUpSessionServer{stream})
   119  }
   120  
   121  type S2AService_SetUpSessionServer interface {
   122  	Send(*SessionResp) error
   123  	Recv() (*SessionReq, error)
   124  	grpc.ServerStream
   125  }
   126  
   127  type s2AServiceSetUpSessionServer struct {
   128  	grpc.ServerStream
   129  }
   130  
   131  func (x *s2AServiceSetUpSessionServer) Send(m *SessionResp) error {
   132  	return x.ServerStream.SendMsg(m)
   133  }
   134  
   135  func (x *s2AServiceSetUpSessionServer) Recv() (*SessionReq, error) {
   136  	m := new(SessionReq)
   137  	if err := x.ServerStream.RecvMsg(m); err != nil {
   138  		return nil, err
   139  	}
   140  	return m, nil
   141  }
   142  
   143  // S2AService_ServiceDesc is the grpc.ServiceDesc for S2AService service.
   144  // It's only intended for direct use with grpc.RegisterService,
   145  // and not to be introspected or modified (even as a copy)
   146  var S2AService_ServiceDesc = grpc.ServiceDesc{
   147  	ServiceName: "s2a.proto.v2.S2AService",
   148  	HandlerType: (*S2AServiceServer)(nil),
   149  	Methods:     []grpc.MethodDesc{},
   150  	Streams: []grpc.StreamDesc{
   151  		{
   152  			StreamName:    "SetUpSession",
   153  			Handler:       _S2AService_SetUpSession_Handler,
   154  			ServerStreams: true,
   155  			ClientStreams: true,
   156  		},
   157  	},
   158  	Metadata: "internal/proto/v2/s2a/s2a.proto",
   159  }
   160  

View as plain text