grpclibrary

package
v0.0.0-...-210daab Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 2, 2021 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_protocol_library_proto protoreflect.FileDescriptor
View Source
var Library_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "library.Library",
	HandlerType: (*LibraryServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "CreateLibrary",
			Handler:    _Library_CreateLibrary_Handler,
		},
		{
			MethodName: "UploadAuthorization",
			Handler:    _Library_UploadAuthorization_Handler,
		},
		{
			MethodName: "BookUploaded",
			Handler:    _Library_BookUploaded_Handler,
		},
		{
			MethodName: "CoverUploaded",
			Handler:    _Library_CoverUploaded_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "protocol/library.proto",
}

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)

Functions

func RegisterLibraryServer

func RegisterLibraryServer(s grpc.ServiceRegistrar, srv LibraryServer)

Types

type BookUploadedRequest

type BookUploadedRequest struct {
	BookID string `protobuf:"bytes,1,opt,name=BookID,proto3" json:"BookID,omitempty"`
	Type   string `protobuf:"bytes,2,opt,name=Type,proto3" json:"Type,omitempty"`
	// contains filtered or unexported fields
}

func (*BookUploadedRequest) Descriptor deprecated

func (*BookUploadedRequest) Descriptor() ([]byte, []int)

Deprecated: Use BookUploadedRequest.ProtoReflect.Descriptor instead.

func (*BookUploadedRequest) GetBookID

func (x *BookUploadedRequest) GetBookID() string

func (*BookUploadedRequest) GetType

func (x *BookUploadedRequest) GetType() string

func (*BookUploadedRequest) ProtoMessage

func (*BookUploadedRequest) ProtoMessage()

func (*BookUploadedRequest) ProtoReflect

func (x *BookUploadedRequest) ProtoReflect() protoreflect.Message

func (*BookUploadedRequest) Reset

func (x *BookUploadedRequest) Reset()

func (*BookUploadedRequest) String

func (x *BookUploadedRequest) String() string

type CoverUploadedRequest

type CoverUploadedRequest struct {
	BookID   string `protobuf:"bytes,1,opt,name=BookID,proto3" json:"BookID,omitempty"`
	CoverURL string `protobuf:"bytes,2,opt,name=CoverURL,proto3" json:"CoverURL,omitempty"`
	// contains filtered or unexported fields
}

func (*CoverUploadedRequest) Descriptor deprecated

func (*CoverUploadedRequest) Descriptor() ([]byte, []int)

Deprecated: Use CoverUploadedRequest.ProtoReflect.Descriptor instead.

func (*CoverUploadedRequest) GetBookID

func (x *CoverUploadedRequest) GetBookID() string

func (*CoverUploadedRequest) GetCoverURL

func (x *CoverUploadedRequest) GetCoverURL() string

func (*CoverUploadedRequest) ProtoMessage

func (*CoverUploadedRequest) ProtoMessage()

func (*CoverUploadedRequest) ProtoReflect

func (x *CoverUploadedRequest) ProtoReflect() protoreflect.Message

func (*CoverUploadedRequest) Reset

func (x *CoverUploadedRequest) Reset()

func (*CoverUploadedRequest) String

func (x *CoverUploadedRequest) String() string

type CreateLibraryRequest

type CreateLibraryRequest struct {
	UserID string `protobuf:"bytes,1,opt,name=UserID,proto3" json:"UserID,omitempty"`
	// contains filtered or unexported fields
}

func (*CreateLibraryRequest) Descriptor deprecated

func (*CreateLibraryRequest) Descriptor() ([]byte, []int)

Deprecated: Use CreateLibraryRequest.ProtoReflect.Descriptor instead.

func (*CreateLibraryRequest) GetUserID

func (x *CreateLibraryRequest) GetUserID() string

func (*CreateLibraryRequest) ProtoMessage

func (*CreateLibraryRequest) ProtoMessage()

func (*CreateLibraryRequest) ProtoReflect

func (x *CreateLibraryRequest) ProtoReflect() protoreflect.Message

func (*CreateLibraryRequest) Reset

func (x *CreateLibraryRequest) Reset()

func (*CreateLibraryRequest) String

func (x *CreateLibraryRequest) String() string

type LibraryClient

type LibraryClient interface {
	// CreateLibrary is used to create the default library after a user creation
	CreateLibrary(ctx context.Context, in *CreateLibraryRequest, opts ...grpc.CallOption) (*empty.Empty, error)
	// UploadAuthorization check if a user can upload a book to a library
	UploadAuthorization(ctx context.Context, in *UploadAuthorizationRequest, opts ...grpc.CallOption) (*UploadAuthorizationReply, error)
	// BookUploaded set the file type of the uploaded book in the book metadata
	BookUploaded(ctx context.Context, in *BookUploadedRequest, opts ...grpc.CallOption) (*empty.Empty, error)
	// CoverUploaded set the url of the uploaded cover in the book metadata
	CoverUploaded(ctx context.Context, in *CoverUploadedRequest, opts ...grpc.CallOption) (*empty.Empty, error)
}

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.

func NewLibraryClient

func NewLibraryClient(cc grpc.ClientConnInterface) LibraryClient

type LibraryServer

type LibraryServer interface {
	// CreateLibrary is used to create the default library after a user creation
	CreateLibrary(context.Context, *CreateLibraryRequest) (*empty.Empty, error)
	// UploadAuthorization check if a user can upload a book to a library
	UploadAuthorization(context.Context, *UploadAuthorizationRequest) (*UploadAuthorizationReply, error)
	// BookUploaded set the file type of the uploaded book in the book metadata
	BookUploaded(context.Context, *BookUploadedRequest) (*empty.Empty, error)
	// CoverUploaded set the url of the uploaded cover in the book metadata
	CoverUploaded(context.Context, *CoverUploadedRequest) (*empty.Empty, error)
	// contains filtered or unexported methods
}

LibraryServer is the server API for Library service. All implementations must embed UnimplementedLibraryServer for forward compatibility

type UnimplementedLibraryServer

type UnimplementedLibraryServer struct {
}

UnimplementedLibraryServer must be embedded to have forward compatible implementations.

func (UnimplementedLibraryServer) BookUploaded

func (UnimplementedLibraryServer) CoverUploaded

func (UnimplementedLibraryServer) CreateLibrary

type UnsafeLibraryServer

type UnsafeLibraryServer interface {
	// contains filtered or unexported methods
}

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 UploadAuthorizationReply

type UploadAuthorizationReply struct {
	Authorized bool `protobuf:"varint,1,opt,name=Authorized,proto3" json:"Authorized,omitempty"`
	// contains filtered or unexported fields
}

func (*UploadAuthorizationReply) Descriptor deprecated

func (*UploadAuthorizationReply) Descriptor() ([]byte, []int)

Deprecated: Use UploadAuthorizationReply.ProtoReflect.Descriptor instead.

func (*UploadAuthorizationReply) GetAuthorized

func (x *UploadAuthorizationReply) GetAuthorized() bool

func (*UploadAuthorizationReply) ProtoMessage

func (*UploadAuthorizationReply) ProtoMessage()

func (*UploadAuthorizationReply) ProtoReflect

func (x *UploadAuthorizationReply) ProtoReflect() protoreflect.Message

func (*UploadAuthorizationReply) Reset

func (x *UploadAuthorizationReply) Reset()

func (*UploadAuthorizationReply) String

func (x *UploadAuthorizationReply) String() string

type UploadAuthorizationRequest

type UploadAuthorizationRequest struct {
	UserID    string `protobuf:"bytes,1,opt,name=UserID,proto3" json:"UserID,omitempty"`
	LibraryID string `protobuf:"bytes,2,opt,name=LibraryID,proto3" json:"LibraryID,omitempty"`
	// contains filtered or unexported fields
}

func (*UploadAuthorizationRequest) Descriptor deprecated

func (*UploadAuthorizationRequest) Descriptor() ([]byte, []int)

Deprecated: Use UploadAuthorizationRequest.ProtoReflect.Descriptor instead.

func (*UploadAuthorizationRequest) GetLibraryID

func (x *UploadAuthorizationRequest) GetLibraryID() string

func (*UploadAuthorizationRequest) GetUserID

func (x *UploadAuthorizationRequest) GetUserID() string

func (*UploadAuthorizationRequest) ProtoMessage

func (*UploadAuthorizationRequest) ProtoMessage()

func (*UploadAuthorizationRequest) ProtoReflect

func (*UploadAuthorizationRequest) Reset

func (x *UploadAuthorizationRequest) Reset()

func (*UploadAuthorizationRequest) String

func (x *UploadAuthorizationRequest) String() string

Directories

Path Synopsis
Package mock_grpclibrary is a generated GoMock package.
Package mock_grpclibrary is a generated GoMock package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL