// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.6.2
// - protoc             v7.35.0
// source: module/ec/address/proto/address.proto

package address

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 (
	Library_Create_FullMethodName = "/address.Library/Create"
	Library_Modify_FullMethodName = "/address.Library/Modify"
	Library_Get_FullMethodName    = "/address.Library/Get"
	Library_Fetch_FullMethodName  = "/address.Library/Fetch"
	Library_Delete_FullMethodName = "/address.Library/Delete"
)

// LibraryClient is the client API for Library 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 LibraryClient interface {
	// 新增地址
	Create(ctx context.Context, in *AddressCreateRequest, opts ...grpc.CallOption) (*StatusReply, error)
	// 修改地址
	Modify(ctx context.Context, in *AddressItem, opts ...grpc.CallOption) (*StatusReply, error)
	// 获取一条地址
	Get(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*AddressItem, error)
	// 获取地址列表
	Fetch(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*AddressListReply, error)
	// 删除一个地址
	Delete(ctx context.Context, in *AddressDeleteRequest, opts ...grpc.CallOption) (*StatusReply, error)
}

type libraryClient struct {
	cc grpc.ClientConnInterface
}

func NewLibraryClient(cc grpc.ClientConnInterface) LibraryClient {
	return &libraryClient{cc}
}

func (c *libraryClient) Create(ctx context.Context, in *AddressCreateRequest, opts ...grpc.CallOption) (*StatusReply, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(StatusReply)
	err := c.cc.Invoke(ctx, Library_Create_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *libraryClient) Modify(ctx context.Context, in *AddressItem, opts ...grpc.CallOption) (*StatusReply, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(StatusReply)
	err := c.cc.Invoke(ctx, Library_Modify_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *libraryClient) Get(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*AddressItem, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(AddressItem)
	err := c.cc.Invoke(ctx, Library_Get_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *libraryClient) Fetch(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*AddressListReply, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(AddressListReply)
	err := c.cc.Invoke(ctx, Library_Fetch_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *libraryClient) Delete(ctx context.Context, in *AddressDeleteRequest, opts ...grpc.CallOption) (*StatusReply, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(StatusReply)
	err := c.cc.Invoke(ctx, Library_Delete_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// LibraryServer is the server API for Library service.
// All implementations should embed UnimplementedLibraryServer
// for forward compatibility.
//
// 地址库
type LibraryServer interface {
	// 新增地址
	Create(context.Context, *AddressCreateRequest) (*StatusReply, error)
	// 修改地址
	Modify(context.Context, *AddressItem) (*StatusReply, error)
	// 获取一条地址
	Get(context.Context, *IdentRequest) (*AddressItem, error)
	// 获取地址列表
	Fetch(context.Context, *IdentRequest) (*AddressListReply, error)
	// 删除一个地址
	Delete(context.Context, *AddressDeleteRequest) (*StatusReply, error)
}

// UnimplementedLibraryServer should 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 UnimplementedLibraryServer struct{}

func (UnimplementedLibraryServer) Create(context.Context, *AddressCreateRequest) (*StatusReply, error) {
	return nil, status.Error(codes.Unimplemented, "method Create not implemented")
}
func (UnimplementedLibraryServer) Modify(context.Context, *AddressItem) (*StatusReply, error) {
	return nil, status.Error(codes.Unimplemented, "method Modify not implemented")
}
func (UnimplementedLibraryServer) Get(context.Context, *IdentRequest) (*AddressItem, error) {
	return nil, status.Error(codes.Unimplemented, "method Get not implemented")
}
func (UnimplementedLibraryServer) Fetch(context.Context, *IdentRequest) (*AddressListReply, error) {
	return nil, status.Error(codes.Unimplemented, "method Fetch not implemented")
}
func (UnimplementedLibraryServer) Delete(context.Context, *AddressDeleteRequest) (*StatusReply, error) {
	return nil, status.Error(codes.Unimplemented, "method Delete not implemented")
}
func (UnimplementedLibraryServer) testEmbeddedByValue() {}

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

func RegisterLibraryServer(s grpc.ServiceRegistrar, srv LibraryServer) {
	// If the following call panics, it indicates UnimplementedLibraryServer 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(&Library_ServiceDesc, srv)
}

func _Library_Create_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(AddressCreateRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(LibraryServer).Create(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: Library_Create_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(LibraryServer).Create(ctx, req.(*AddressCreateRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Library_Modify_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(AddressItem)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(LibraryServer).Modify(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: Library_Modify_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(LibraryServer).Modify(ctx, req.(*AddressItem))
	}
	return interceptor(ctx, in, info, handler)
}

func _Library_Get_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(IdentRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(LibraryServer).Get(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: Library_Get_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(LibraryServer).Get(ctx, req.(*IdentRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Library_Fetch_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(IdentRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(LibraryServer).Fetch(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: Library_Fetch_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(LibraryServer).Fetch(ctx, req.(*IdentRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Library_Delete_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(AddressDeleteRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(LibraryServer).Delete(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: Library_Delete_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(LibraryServer).Delete(ctx, req.(*AddressDeleteRequest))
	}
	return interceptor(ctx, in, info, handler)
}

// Library_ServiceDesc is the grpc.ServiceDesc for Library service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var Library_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "address.Library",
	HandlerType: (*LibraryServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Create",
			Handler:    _Library_Create_Handler,
		},
		{
			MethodName: "Modify",
			Handler:    _Library_Modify_Handler,
		},
		{
			MethodName: "Get",
			Handler:    _Library_Get_Handler,
		},
		{
			MethodName: "Fetch",
			Handler:    _Library_Fetch_Handler,
		},
		{
			MethodName: "Delete",
			Handler:    _Library_Delete_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "module/ec/address/proto/address.proto",
}
