go-grpc/auth/auth_grpc.pb.go

178 lines
6.3 KiB
Go

// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.2.0
// - protoc v3.21.12
// source: auth.proto
package auth
import (
context "context"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
)
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
// Requires gRPC-Go v1.32.0 or later.
const _ = grpc.SupportPackageIsVersion7
// AuthServiceClient is the client API for AuthService service.
//
// 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.
type AuthServiceClient interface {
GetSessionUser(ctx context.Context, in *IdMessage, opts ...grpc.CallOption) (*SessionUserResponse, error)
GetGroupRole(ctx context.Context, in *IdMessage, opts ...grpc.CallOption) (*RoleReponse, error)
ValidateSession(ctx context.Context, in *IdMessage, opts ...grpc.CallOption) (*ValidateResponse, error)
}
type authServiceClient struct {
cc grpc.ClientConnInterface
}
func NewAuthServiceClient(cc grpc.ClientConnInterface) AuthServiceClient {
return &authServiceClient{cc}
}
func (c *authServiceClient) GetSessionUser(ctx context.Context, in *IdMessage, opts ...grpc.CallOption) (*SessionUserResponse, error) {
out := new(SessionUserResponse)
err := c.cc.Invoke(ctx, "/auth.AuthService/GetSessionUser", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *authServiceClient) GetGroupRole(ctx context.Context, in *IdMessage, opts ...grpc.CallOption) (*RoleReponse, error) {
out := new(RoleReponse)
err := c.cc.Invoke(ctx, "/auth.AuthService/GetGroupRole", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *authServiceClient) ValidateSession(ctx context.Context, in *IdMessage, opts ...grpc.CallOption) (*ValidateResponse, error) {
out := new(ValidateResponse)
err := c.cc.Invoke(ctx, "/auth.AuthService/ValidateSession", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// AuthServiceServer is the server API for AuthService service.
// All implementations must embed UnimplementedAuthServiceServer
// for forward compatibility
type AuthServiceServer interface {
GetSessionUser(context.Context, *IdMessage) (*SessionUserResponse, error)
GetGroupRole(context.Context, *IdMessage) (*RoleReponse, error)
ValidateSession(context.Context, *IdMessage) (*ValidateResponse, error)
mustEmbedUnimplementedAuthServiceServer()
}
// UnimplementedAuthServiceServer must be embedded to have forward compatible implementations.
type UnimplementedAuthServiceServer struct {
}
func (UnimplementedAuthServiceServer) GetSessionUser(context.Context, *IdMessage) (*SessionUserResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetSessionUser not implemented")
}
func (UnimplementedAuthServiceServer) GetGroupRole(context.Context, *IdMessage) (*RoleReponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetGroupRole not implemented")
}
func (UnimplementedAuthServiceServer) ValidateSession(context.Context, *IdMessage) (*ValidateResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ValidateSession not implemented")
}
func (UnimplementedAuthServiceServer) mustEmbedUnimplementedAuthServiceServer() {}
// UnsafeAuthServiceServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to AuthServiceServer will
// result in compilation errors.
type UnsafeAuthServiceServer interface {
mustEmbedUnimplementedAuthServiceServer()
}
func RegisterAuthServiceServer(s grpc.ServiceRegistrar, srv AuthServiceServer) {
s.RegisterService(&AuthService_ServiceDesc, srv)
}
func _AuthService_GetSessionUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(IdMessage)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(AuthServiceServer).GetSessionUser(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/auth.AuthService/GetSessionUser",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(AuthServiceServer).GetSessionUser(ctx, req.(*IdMessage))
}
return interceptor(ctx, in, info, handler)
}
func _AuthService_GetGroupRole_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(IdMessage)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(AuthServiceServer).GetGroupRole(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/auth.AuthService/GetGroupRole",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(AuthServiceServer).GetGroupRole(ctx, req.(*IdMessage))
}
return interceptor(ctx, in, info, handler)
}
func _AuthService_ValidateSession_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(IdMessage)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(AuthServiceServer).ValidateSession(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/auth.AuthService/ValidateSession",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(AuthServiceServer).ValidateSession(ctx, req.(*IdMessage))
}
return interceptor(ctx, in, info, handler)
}
// AuthService_ServiceDesc is the grpc.ServiceDesc for AuthService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var AuthService_ServiceDesc = grpc.ServiceDesc{
ServiceName: "auth.AuthService",
HandlerType: (*AuthServiceServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "GetSessionUser",
Handler: _AuthService_GetSessionUser_Handler,
},
{
MethodName: "GetGroupRole",
Handler: _AuthService_GetGroupRole_Handler,
},
{
MethodName: "ValidateSession",
Handler: _AuthService_ValidateSession_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "auth.proto",
}