// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.5.1
// - protoc             (unknown)
// source: aliasreader/aliasreader.proto

package aliasreader

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.64.0 or later.
const _ = grpc.SupportPackageIsVersion9

const (
	AliasReader_Lookup_FullMethodName       = "/aliasreader.AliasReader/Lookup"
	AliasReader_PrimaryAlias_FullMethodName = "/aliasreader.AliasReader/PrimaryAlias"
	AliasReader_Aliases_FullMethodName      = "/aliasreader.AliasReader/Aliases"
)

// AliasReaderClient is the client API for AliasReader 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 AliasReaderClient interface {
	Lookup(ctx context.Context, in *Alias, opts ...grpc.CallOption) (*ID, error)
	PrimaryAlias(ctx context.Context, in *ID, opts ...grpc.CallOption) (*Alias, error)
	Aliases(ctx context.Context, in *ID, opts ...grpc.CallOption) (*AliasList, error)
}

type aliasReaderClient struct {
	cc grpc.ClientConnInterface
}

func NewAliasReaderClient(cc grpc.ClientConnInterface) AliasReaderClient {
	return &aliasReaderClient{cc}
}

func (c *aliasReaderClient) Lookup(ctx context.Context, in *Alias, opts ...grpc.CallOption) (*ID, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(ID)
	err := c.cc.Invoke(ctx, AliasReader_Lookup_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *aliasReaderClient) PrimaryAlias(ctx context.Context, in *ID, opts ...grpc.CallOption) (*Alias, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(Alias)
	err := c.cc.Invoke(ctx, AliasReader_PrimaryAlias_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *aliasReaderClient) Aliases(ctx context.Context, in *ID, opts ...grpc.CallOption) (*AliasList, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(AliasList)
	err := c.cc.Invoke(ctx, AliasReader_Aliases_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// AliasReaderServer is the server API for AliasReader service.
// All implementations must embed UnimplementedAliasReaderServer
// for forward compatibility.
type AliasReaderServer interface {
	Lookup(context.Context, *Alias) (*ID, error)
	PrimaryAlias(context.Context, *ID) (*Alias, error)
	Aliases(context.Context, *ID) (*AliasList, error)
	mustEmbedUnimplementedAliasReaderServer()
}

// UnimplementedAliasReaderServer must be embedded to have
// forward compatible implementations.
//
// NOTE: this should be embedded by value instead of pointer to avoid a nil
// pointer dereference when methods are called.
type UnimplementedAliasReaderServer struct{}

func (UnimplementedAliasReaderServer) Lookup(context.Context, *Alias) (*ID, error) {
	return nil, status.Errorf(codes.Unimplemented, "method Lookup not implemented")
}
func (UnimplementedAliasReaderServer) PrimaryAlias(context.Context, *ID) (*Alias, error) {
	return nil, status.Errorf(codes.Unimplemented, "method PrimaryAlias not implemented")
}
func (UnimplementedAliasReaderServer) Aliases(context.Context, *ID) (*AliasList, error) {
	return nil, status.Errorf(codes.Unimplemented, "method Aliases not implemented")
}
func (UnimplementedAliasReaderServer) mustEmbedUnimplementedAliasReaderServer() {}
func (UnimplementedAliasReaderServer) testEmbeddedByValue()                     {}

// UnsafeAliasReaderServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to AliasReaderServer will
// result in compilation errors.
type UnsafeAliasReaderServer interface {
	mustEmbedUnimplementedAliasReaderServer()
}

func RegisterAliasReaderServer(s grpc.ServiceRegistrar, srv AliasReaderServer) {
	// If the following call pancis, it indicates UnimplementedAliasReaderServer was
	// embedded by pointer and is nil.  This will cause panics if an
	// unimplemented method is ever invoked, so we test this at initialization
	// time to prevent it from happening at runtime later due to I/O.
	if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
		t.testEmbeddedByValue()
	}
	s.RegisterService(&AliasReader_ServiceDesc, srv)
}

func _AliasReader_Lookup_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(Alias)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(AliasReaderServer).Lookup(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: AliasReader_Lookup_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(AliasReaderServer).Lookup(ctx, req.(*Alias))
	}
	return interceptor(ctx, in, info, handler)
}

func _AliasReader_PrimaryAlias_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(ID)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(AliasReaderServer).PrimaryAlias(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: AliasReader_PrimaryAlias_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(AliasReaderServer).PrimaryAlias(ctx, req.(*ID))
	}
	return interceptor(ctx, in, info, handler)
}

func _AliasReader_Aliases_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(ID)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(AliasReaderServer).Aliases(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: AliasReader_Aliases_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(AliasReaderServer).Aliases(ctx, req.(*ID))
	}
	return interceptor(ctx, in, info, handler)
}

// AliasReader_ServiceDesc is the grpc.ServiceDesc for AliasReader service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var AliasReader_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "aliasreader.AliasReader",
	HandlerType: (*AliasReaderServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Lookup",
			Handler:    _AliasReader_Lookup_Handler,
		},
		{
			MethodName: "PrimaryAlias",
			Handler:    _AliasReader_PrimaryAlias_Handler,
		},
		{
			MethodName: "Aliases",
			Handler:    _AliasReader_Aliases_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "aliasreader/aliasreader.proto",
}
