main
  1// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
  2// versions:
  3// - protoc-gen-go-grpc v1.5.1
  4// - protoc             v3.19.6
  5// source: ability.proto
  6
  7package rpc
  8
  9import (
 10	context "context"
 11	grpc "google.golang.org/grpc"
 12	codes "google.golang.org/grpc/codes"
 13	status "google.golang.org/grpc/status"
 14)
 15
 16// This is a compile-time assertion to ensure that this generated file
 17// is compatible with the grpc package it is being compiled against.
 18// Requires gRPC-Go v1.64.0 or later.
 19const _ = grpc.SupportPackageIsVersion9
 20
 21const (
 22	Ability_Allowed_FullMethodName = "/authx.rpc.Ability/Allowed"
 23)
 24
 25// AbilityClient is the client API for Ability service.
 26//
 27// 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.
 28type AbilityClient interface {
 29	Allowed(ctx context.Context, in *AllowRequest, opts ...grpc.CallOption) (*AllowReply, error)
 30}
 31
 32type abilityClient struct {
 33	cc grpc.ClientConnInterface
 34}
 35
 36func NewAbilityClient(cc grpc.ClientConnInterface) AbilityClient {
 37	return &abilityClient{cc}
 38}
 39
 40func (c *abilityClient) Allowed(ctx context.Context, in *AllowRequest, opts ...grpc.CallOption) (*AllowReply, error) {
 41	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
 42	out := new(AllowReply)
 43	err := c.cc.Invoke(ctx, Ability_Allowed_FullMethodName, in, out, cOpts...)
 44	if err != nil {
 45		return nil, err
 46	}
 47	return out, nil
 48}
 49
 50// AbilityServer is the server API for Ability service.
 51// All implementations must embed UnimplementedAbilityServer
 52// for forward compatibility.
 53type AbilityServer interface {
 54	Allowed(context.Context, *AllowRequest) (*AllowReply, error)
 55	mustEmbedUnimplementedAbilityServer()
 56}
 57
 58// UnimplementedAbilityServer must be embedded to have
 59// forward compatible implementations.
 60//
 61// NOTE: this should be embedded by value instead of pointer to avoid a nil
 62// pointer dereference when methods are called.
 63type UnimplementedAbilityServer struct{}
 64
 65func (UnimplementedAbilityServer) Allowed(context.Context, *AllowRequest) (*AllowReply, error) {
 66	return nil, status.Errorf(codes.Unimplemented, "method Allowed not implemented")
 67}
 68func (UnimplementedAbilityServer) mustEmbedUnimplementedAbilityServer() {}
 69func (UnimplementedAbilityServer) testEmbeddedByValue()                 {}
 70
 71// UnsafeAbilityServer may be embedded to opt out of forward compatibility for this service.
 72// Use of this interface is not recommended, as added methods to AbilityServer will
 73// result in compilation errors.
 74type UnsafeAbilityServer interface {
 75	mustEmbedUnimplementedAbilityServer()
 76}
 77
 78func RegisterAbilityServer(s grpc.ServiceRegistrar, srv AbilityServer) {
 79	// If the following call pancis, it indicates UnimplementedAbilityServer was
 80	// embedded by pointer and is nil.  This will cause panics if an
 81	// unimplemented method is ever invoked, so we test this at initialization
 82	// time to prevent it from happening at runtime later due to I/O.
 83	if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
 84		t.testEmbeddedByValue()
 85	}
 86	s.RegisterService(&Ability_ServiceDesc, srv)
 87}
 88
 89func _Ability_Allowed_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
 90	in := new(AllowRequest)
 91	if err := dec(in); err != nil {
 92		return nil, err
 93	}
 94	if interceptor == nil {
 95		return srv.(AbilityServer).Allowed(ctx, in)
 96	}
 97	info := &grpc.UnaryServerInfo{
 98		Server:     srv,
 99		FullMethod: Ability_Allowed_FullMethodName,
100	}
101	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
102		return srv.(AbilityServer).Allowed(ctx, req.(*AllowRequest))
103	}
104	return interceptor(ctx, in, info, handler)
105}
106
107// Ability_ServiceDesc is the grpc.ServiceDesc for Ability service.
108// It's only intended for direct use with grpc.RegisterService,
109// and not to be introspected or modified (even as a copy)
110var Ability_ServiceDesc = grpc.ServiceDesc{
111	ServiceName: "authx.rpc.Ability",
112	HandlerType: (*AbilityServer)(nil),
113	Methods: []grpc.MethodDesc{
114		{
115			MethodName: "Allowed",
116			Handler:    _Ability_Allowed_Handler,
117		},
118	},
119	Streams:  []grpc.StreamDesc{},
120	Metadata: "ability.proto",
121}