Initial QSfera import
This commit is contained in:
@@ -0,0 +1,123 @@
|
||||
// Code generated by mockery; DO NOT EDIT.
|
||||
// github.com/vektra/mockery
|
||||
// template: testify
|
||||
|
||||
package mocks
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/qsfera/server/protogen/gen/qsfera/services/thumbnails/v0"
|
||||
mock "github.com/stretchr/testify/mock"
|
||||
"go-micro.dev/v4/client"
|
||||
)
|
||||
|
||||
// NewThumbnailService creates a new instance of ThumbnailService. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
|
||||
// The first argument is typically a *testing.T value.
|
||||
func NewThumbnailService(t interface {
|
||||
mock.TestingT
|
||||
Cleanup(func())
|
||||
}) *ThumbnailService {
|
||||
mock := &ThumbnailService{}
|
||||
mock.Mock.Test(t)
|
||||
|
||||
t.Cleanup(func() { mock.AssertExpectations(t) })
|
||||
|
||||
return mock
|
||||
}
|
||||
|
||||
// ThumbnailService is an autogenerated mock type for the ThumbnailService type
|
||||
type ThumbnailService struct {
|
||||
mock.Mock
|
||||
}
|
||||
|
||||
type ThumbnailService_Expecter struct {
|
||||
mock *mock.Mock
|
||||
}
|
||||
|
||||
func (_m *ThumbnailService) EXPECT() *ThumbnailService_Expecter {
|
||||
return &ThumbnailService_Expecter{mock: &_m.Mock}
|
||||
}
|
||||
|
||||
// GetThumbnail provides a mock function for the type ThumbnailService
|
||||
func (_mock *ThumbnailService) GetThumbnail(ctx context.Context, in *v0.GetThumbnailRequest, opts ...client.CallOption) (*v0.GetThumbnailResponse, error) {
|
||||
var tmpRet mock.Arguments
|
||||
if len(opts) > 0 {
|
||||
tmpRet = _mock.Called(ctx, in, opts)
|
||||
} else {
|
||||
tmpRet = _mock.Called(ctx, in)
|
||||
}
|
||||
ret := tmpRet
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for GetThumbnail")
|
||||
}
|
||||
|
||||
var r0 *v0.GetThumbnailResponse
|
||||
var r1 error
|
||||
if returnFunc, ok := ret.Get(0).(func(context.Context, *v0.GetThumbnailRequest, ...client.CallOption) (*v0.GetThumbnailResponse, error)); ok {
|
||||
return returnFunc(ctx, in, opts...)
|
||||
}
|
||||
if returnFunc, ok := ret.Get(0).(func(context.Context, *v0.GetThumbnailRequest, ...client.CallOption) *v0.GetThumbnailResponse); ok {
|
||||
r0 = returnFunc(ctx, in, opts...)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*v0.GetThumbnailResponse)
|
||||
}
|
||||
}
|
||||
if returnFunc, ok := ret.Get(1).(func(context.Context, *v0.GetThumbnailRequest, ...client.CallOption) error); ok {
|
||||
r1 = returnFunc(ctx, in, opts...)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// ThumbnailService_GetThumbnail_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetThumbnail'
|
||||
type ThumbnailService_GetThumbnail_Call struct {
|
||||
*mock.Call
|
||||
}
|
||||
|
||||
// GetThumbnail is a helper method to define mock.On call
|
||||
// - ctx context.Context
|
||||
// - in *v0.GetThumbnailRequest
|
||||
// - opts ...client.CallOption
|
||||
func (_e *ThumbnailService_Expecter) GetThumbnail(ctx interface{}, in interface{}, opts ...interface{}) *ThumbnailService_GetThumbnail_Call {
|
||||
return &ThumbnailService_GetThumbnail_Call{Call: _e.mock.On("GetThumbnail",
|
||||
append([]interface{}{ctx, in}, opts...)...)}
|
||||
}
|
||||
|
||||
func (_c *ThumbnailService_GetThumbnail_Call) Run(run func(ctx context.Context, in *v0.GetThumbnailRequest, opts ...client.CallOption)) *ThumbnailService_GetThumbnail_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
var arg0 context.Context
|
||||
if args[0] != nil {
|
||||
arg0 = args[0].(context.Context)
|
||||
}
|
||||
var arg1 *v0.GetThumbnailRequest
|
||||
if args[1] != nil {
|
||||
arg1 = args[1].(*v0.GetThumbnailRequest)
|
||||
}
|
||||
var arg2 []client.CallOption
|
||||
var variadicArgs []client.CallOption
|
||||
if len(args) > 2 {
|
||||
variadicArgs = args[2].([]client.CallOption)
|
||||
}
|
||||
arg2 = variadicArgs
|
||||
run(
|
||||
arg0,
|
||||
arg1,
|
||||
arg2...,
|
||||
)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *ThumbnailService_GetThumbnail_Call) Return(getThumbnailResponse *v0.GetThumbnailResponse, err error) *ThumbnailService_GetThumbnail_Call {
|
||||
_c.Call.Return(getThumbnailResponse, err)
|
||||
return _c
|
||||
}
|
||||
|
||||
func (_c *ThumbnailService_GetThumbnail_Call) RunAndReturn(run func(ctx context.Context, in *v0.GetThumbnailRequest, opts ...client.CallOption) (*v0.GetThumbnailResponse, error)) *ThumbnailService_GetThumbnail_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
@@ -0,0 +1,388 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.28.1
|
||||
// protoc (unknown)
|
||||
// source: qsfera/services/thumbnails/v0/thumbnails.proto
|
||||
|
||||
package v0
|
||||
|
||||
import (
|
||||
_ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options"
|
||||
v0 "github.com/qsfera/server/protogen/gen/qsfera/messages/thumbnails/v0"
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
// A request to retrieve a thumbnail
|
||||
type GetThumbnailRequest struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
// The path to the source image
|
||||
Filepath string `protobuf:"bytes,1,opt,name=filepath,proto3" json:"filepath,omitempty"`
|
||||
// The type to which the thumbnail should get encoded to.
|
||||
ThumbnailType v0.ThumbnailType `protobuf:"varint,2,opt,name=thumbnail_type,json=thumbnailType,proto3,enum=qsfera.messages.thumbnails.v0.ThumbnailType" json:"thumbnail_type,omitempty"`
|
||||
// The width of the thumbnail
|
||||
Width int32 `protobuf:"varint,3,opt,name=width,proto3" json:"width,omitempty"`
|
||||
// The height of the thumbnail
|
||||
Height int32 `protobuf:"varint,4,opt,name=height,proto3" json:"height,omitempty"`
|
||||
// Indicates which image processor to use
|
||||
Processor string `protobuf:"bytes,5,opt,name=processor,proto3" json:"processor,omitempty"`
|
||||
// Types that are assignable to Source:
|
||||
//
|
||||
// *GetThumbnailRequest_WebdavSource
|
||||
// *GetThumbnailRequest_Cs3Source
|
||||
Source isGetThumbnailRequest_Source `protobuf_oneof:"source"`
|
||||
}
|
||||
|
||||
func (x *GetThumbnailRequest) Reset() {
|
||||
*x = GetThumbnailRequest{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_qsfera_services_thumbnails_v0_thumbnails_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *GetThumbnailRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*GetThumbnailRequest) ProtoMessage() {}
|
||||
|
||||
func (x *GetThumbnailRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_qsfera_services_thumbnails_v0_thumbnails_proto_msgTypes[0]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use GetThumbnailRequest.ProtoReflect.Descriptor instead.
|
||||
func (*GetThumbnailRequest) Descriptor() ([]byte, []int) {
|
||||
return file_qsfera_services_thumbnails_v0_thumbnails_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *GetThumbnailRequest) GetFilepath() string {
|
||||
if x != nil {
|
||||
return x.Filepath
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *GetThumbnailRequest) GetThumbnailType() v0.ThumbnailType {
|
||||
if x != nil {
|
||||
return x.ThumbnailType
|
||||
}
|
||||
return v0.ThumbnailType(0)
|
||||
}
|
||||
|
||||
func (x *GetThumbnailRequest) GetWidth() int32 {
|
||||
if x != nil {
|
||||
return x.Width
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *GetThumbnailRequest) GetHeight() int32 {
|
||||
if x != nil {
|
||||
return x.Height
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *GetThumbnailRequest) GetProcessor() string {
|
||||
if x != nil {
|
||||
return x.Processor
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *GetThumbnailRequest) GetSource() isGetThumbnailRequest_Source {
|
||||
if m != nil {
|
||||
return m.Source
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *GetThumbnailRequest) GetWebdavSource() *v0.WebdavSource {
|
||||
if x, ok := x.GetSource().(*GetThumbnailRequest_WebdavSource); ok {
|
||||
return x.WebdavSource
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *GetThumbnailRequest) GetCs3Source() *v0.CS3Source {
|
||||
if x, ok := x.GetSource().(*GetThumbnailRequest_Cs3Source); ok {
|
||||
return x.Cs3Source
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type isGetThumbnailRequest_Source interface {
|
||||
isGetThumbnailRequest_Source()
|
||||
}
|
||||
|
||||
type GetThumbnailRequest_WebdavSource struct {
|
||||
WebdavSource *v0.WebdavSource `protobuf:"bytes,6,opt,name=webdav_source,json=webdavSource,proto3,oneof"`
|
||||
}
|
||||
|
||||
type GetThumbnailRequest_Cs3Source struct {
|
||||
Cs3Source *v0.CS3Source `protobuf:"bytes,7,opt,name=cs3_source,json=cs3Source,proto3,oneof"`
|
||||
}
|
||||
|
||||
func (*GetThumbnailRequest_WebdavSource) isGetThumbnailRequest_Source() {}
|
||||
|
||||
func (*GetThumbnailRequest_Cs3Source) isGetThumbnailRequest_Source() {}
|
||||
|
||||
// The service response
|
||||
type GetThumbnailResponse struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
// The endpoint where the thumbnail can be downloaded.
|
||||
DataEndpoint string `protobuf:"bytes,1,opt,name=data_endpoint,json=dataEndpoint,proto3" json:"data_endpoint,omitempty"`
|
||||
// The transfer token to be able to download the thumbnail.
|
||||
TransferToken string `protobuf:"bytes,2,opt,name=transfer_token,json=transferToken,proto3" json:"transfer_token,omitempty"`
|
||||
// The mimetype of the thumbnail
|
||||
Mimetype string `protobuf:"bytes,3,opt,name=mimetype,proto3" json:"mimetype,omitempty"`
|
||||
}
|
||||
|
||||
func (x *GetThumbnailResponse) Reset() {
|
||||
*x = GetThumbnailResponse{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_qsfera_services_thumbnails_v0_thumbnails_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *GetThumbnailResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*GetThumbnailResponse) ProtoMessage() {}
|
||||
|
||||
func (x *GetThumbnailResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_qsfera_services_thumbnails_v0_thumbnails_proto_msgTypes[1]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use GetThumbnailResponse.ProtoReflect.Descriptor instead.
|
||||
func (*GetThumbnailResponse) Descriptor() ([]byte, []int) {
|
||||
return file_qsfera_services_thumbnails_v0_thumbnails_proto_rawDescGZIP(), []int{1}
|
||||
}
|
||||
|
||||
func (x *GetThumbnailResponse) GetDataEndpoint() string {
|
||||
if x != nil {
|
||||
return x.DataEndpoint
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *GetThumbnailResponse) GetTransferToken() string {
|
||||
if x != nil {
|
||||
return x.TransferToken
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *GetThumbnailResponse) GetMimetype() string {
|
||||
if x != nil {
|
||||
return x.Mimetype
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
var File_qsfera_services_thumbnails_v0_thumbnails_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_qsfera_services_thumbnails_v0_thumbnails_proto_rawDesc = []byte{
|
||||
0x0a, 0x31, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2f, 0x73, 0x65, 0x72, 0x76,
|
||||
0x69, 0x63, 0x65, 0x73, 0x2f, 0x74, 0x68, 0x75, 0x6d, 0x62, 0x6e, 0x61, 0x69, 0x6c, 0x73, 0x2f,
|
||||
0x76, 0x30, 0x2f, 0x74, 0x68, 0x75, 0x6d, 0x62, 0x6e, 0x61, 0x69, 0x6c, 0x73, 0x2e, 0x70, 0x72,
|
||||
0x6f, 0x74, 0x6f, 0x12, 0x20, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x73,
|
||||
0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x74, 0x68, 0x75, 0x6d, 0x62, 0x6e, 0x61, 0x69,
|
||||
0x6c, 0x73, 0x2e, 0x76, 0x30, 0x1a, 0x31, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64,
|
||||
0x2f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x2f, 0x74, 0x68, 0x75, 0x6d, 0x62, 0x6e,
|
||||
0x61, 0x69, 0x6c, 0x73, 0x2f, 0x76, 0x30, 0x2f, 0x74, 0x68, 0x75, 0x6d, 0x62, 0x6e, 0x61, 0x69,
|
||||
0x6c, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63,
|
||||
0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x76, 0x32, 0x2f, 0x6f,
|
||||
0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f,
|
||||
0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x84, 0x03, 0x0a, 0x13, 0x47, 0x65, 0x74,
|
||||
0x54, 0x68, 0x75, 0x6d, 0x62, 0x6e, 0x61, 0x69, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
|
||||
0x12, 0x1a, 0x0a, 0x08, 0x66, 0x69, 0x6c, 0x65, 0x70, 0x61, 0x74, 0x68, 0x18, 0x01, 0x20, 0x01,
|
||||
0x28, 0x09, 0x52, 0x08, 0x66, 0x69, 0x6c, 0x65, 0x70, 0x61, 0x74, 0x68, 0x12, 0x56, 0x0a, 0x0e,
|
||||
0x74, 0x68, 0x75, 0x6d, 0x62, 0x6e, 0x61, 0x69, 0x6c, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02,
|
||||
0x20, 0x01, 0x28, 0x0e, 0x32, 0x2f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64,
|
||||
0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x2e, 0x74, 0x68, 0x75, 0x6d, 0x62, 0x6e,
|
||||
0x61, 0x69, 0x6c, 0x73, 0x2e, 0x76, 0x30, 0x2e, 0x54, 0x68, 0x75, 0x6d, 0x62, 0x6e, 0x61, 0x69,
|
||||
0x6c, 0x54, 0x79, 0x70, 0x65, 0x52, 0x0d, 0x74, 0x68, 0x75, 0x6d, 0x62, 0x6e, 0x61, 0x69, 0x6c,
|
||||
0x54, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x77, 0x69, 0x64, 0x74, 0x68, 0x18, 0x03, 0x20,
|
||||
0x01, 0x28, 0x05, 0x52, 0x05, 0x77, 0x69, 0x64, 0x74, 0x68, 0x12, 0x16, 0x0a, 0x06, 0x68, 0x65,
|
||||
0x69, 0x67, 0x68, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x68, 0x65, 0x69, 0x67,
|
||||
0x68, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x18,
|
||||
0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72,
|
||||
0x12, 0x55, 0x0a, 0x0d, 0x77, 0x65, 0x62, 0x64, 0x61, 0x76, 0x5f, 0x73, 0x6f, 0x75, 0x72, 0x63,
|
||||
0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6c,
|
||||
0x6f, 0x75, 0x64, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x2e, 0x74, 0x68, 0x75,
|
||||
0x6d, 0x62, 0x6e, 0x61, 0x69, 0x6c, 0x73, 0x2e, 0x76, 0x30, 0x2e, 0x57, 0x65, 0x62, 0x64, 0x61,
|
||||
0x76, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x48, 0x00, 0x52, 0x0c, 0x77, 0x65, 0x62, 0x64, 0x61,
|
||||
0x76, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x4c, 0x0a, 0x0a, 0x63, 0x73, 0x33, 0x5f, 0x73,
|
||||
0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x6f, 0x70,
|
||||
0x65, 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73,
|
||||
0x2e, 0x74, 0x68, 0x75, 0x6d, 0x62, 0x6e, 0x61, 0x69, 0x6c, 0x73, 0x2e, 0x76, 0x30, 0x2e, 0x43,
|
||||
0x53, 0x33, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x48, 0x00, 0x52, 0x09, 0x63, 0x73, 0x33, 0x53,
|
||||
0x6f, 0x75, 0x72, 0x63, 0x65, 0x42, 0x08, 0x0a, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x22,
|
||||
0x7e, 0x0a, 0x14, 0x47, 0x65, 0x74, 0x54, 0x68, 0x75, 0x6d, 0x62, 0x6e, 0x61, 0x69, 0x6c, 0x52,
|
||||
0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x64, 0x61, 0x74, 0x61, 0x5f,
|
||||
0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c,
|
||||
0x64, 0x61, 0x74, 0x61, 0x45, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x25, 0x0a, 0x0e,
|
||||
0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02,
|
||||
0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x54, 0x6f,
|
||||
0x6b, 0x65, 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x6d, 0x69, 0x6d, 0x65, 0x74, 0x79, 0x70, 0x65, 0x18,
|
||||
0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6d, 0x69, 0x6d, 0x65, 0x74, 0x79, 0x70, 0x65, 0x32,
|
||||
0x91, 0x01, 0x0a, 0x10, 0x54, 0x68, 0x75, 0x6d, 0x62, 0x6e, 0x61, 0x69, 0x6c, 0x53, 0x65, 0x72,
|
||||
0x76, 0x69, 0x63, 0x65, 0x12, 0x7d, 0x0a, 0x0c, 0x47, 0x65, 0x74, 0x54, 0x68, 0x75, 0x6d, 0x62,
|
||||
0x6e, 0x61, 0x69, 0x6c, 0x12, 0x35, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64,
|
||||
0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x74, 0x68, 0x75, 0x6d, 0x62, 0x6e,
|
||||
0x61, 0x69, 0x6c, 0x73, 0x2e, 0x76, 0x30, 0x2e, 0x47, 0x65, 0x74, 0x54, 0x68, 0x75, 0x6d, 0x62,
|
||||
0x6e, 0x61, 0x69, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x36, 0x2e, 0x6f, 0x70,
|
||||
0x65, 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73,
|
||||
0x2e, 0x74, 0x68, 0x75, 0x6d, 0x62, 0x6e, 0x61, 0x69, 0x6c, 0x73, 0x2e, 0x76, 0x30, 0x2e, 0x47,
|
||||
0x65, 0x74, 0x54, 0x68, 0x75, 0x6d, 0x62, 0x6e, 0x61, 0x69, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f,
|
||||
0x6e, 0x73, 0x65, 0x42, 0xff, 0x02, 0x5a, 0x4f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63,
|
||||
0x6f, 0x6d, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2d, 0x65, 0x75, 0x2f,
|
||||
0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x67,
|
||||
0x65, 0x6e, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64,
|
||||
0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2f, 0x74, 0x68, 0x75, 0x6d, 0x62, 0x6e,
|
||||
0x61, 0x69, 0x6c, 0x73, 0x2f, 0x76, 0x30, 0x92, 0x41, 0xaa, 0x02, 0x12, 0xbb, 0x01, 0x0a, 0x14,
|
||||
0x4f, 0x70, 0x65, 0x6e, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x20, 0x74, 0x68, 0x75, 0x6d, 0x62, 0x6e,
|
||||
0x61, 0x69, 0x6c, 0x73, 0x22, 0x51, 0x0a, 0x0e, 0x4f, 0x70, 0x65, 0x6e, 0x43, 0x6c, 0x6f, 0x75,
|
||||
0x64, 0x20, 0x47, 0x6d, 0x62, 0x48, 0x12, 0x29, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f,
|
||||
0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x63,
|
||||
0x6c, 0x6f, 0x75, 0x64, 0x2d, 0x65, 0x75, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6c, 0x6f, 0x75,
|
||||
0x64, 0x1a, 0x14, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x40, 0x6f, 0x70, 0x65, 0x6e, 0x63,
|
||||
0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x65, 0x75, 0x2a, 0x49, 0x0a, 0x0a, 0x41, 0x70, 0x61, 0x63, 0x68,
|
||||
0x65, 0x2d, 0x32, 0x2e, 0x30, 0x12, 0x3b, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x67,
|
||||
0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6c,
|
||||
0x6f, 0x75, 0x64, 0x2d, 0x65, 0x75, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64,
|
||||
0x2f, 0x62, 0x6c, 0x6f, 0x62, 0x2f, 0x6d, 0x61, 0x69, 0x6e, 0x2f, 0x4c, 0x49, 0x43, 0x45, 0x4e,
|
||||
0x53, 0x45, 0x32, 0x05, 0x31, 0x2e, 0x30, 0x2e, 0x30, 0x2a, 0x02, 0x01, 0x02, 0x32, 0x10, 0x61,
|
||||
0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x6a, 0x73, 0x6f, 0x6e, 0x3a,
|
||||
0x10, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x6a, 0x73, 0x6f,
|
||||
0x6e, 0x72, 0x42, 0x0a, 0x10, 0x44, 0x65, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x72, 0x20, 0x4d,
|
||||
0x61, 0x6e, 0x75, 0x61, 0x6c, 0x12, 0x2e, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x64,
|
||||
0x6f, 0x63, 0x73, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x65, 0x75,
|
||||
0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2f, 0x74, 0x68, 0x75, 0x6d, 0x62, 0x6e,
|
||||
0x61, 0x69, 0x6c, 0x73, 0x2f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_qsfera_services_thumbnails_v0_thumbnails_proto_rawDescOnce sync.Once
|
||||
file_qsfera_services_thumbnails_v0_thumbnails_proto_rawDescData = file_qsfera_services_thumbnails_v0_thumbnails_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_qsfera_services_thumbnails_v0_thumbnails_proto_rawDescGZIP() []byte {
|
||||
file_qsfera_services_thumbnails_v0_thumbnails_proto_rawDescOnce.Do(func() {
|
||||
file_qsfera_services_thumbnails_v0_thumbnails_proto_rawDescData = protoimpl.X.CompressGZIP(file_qsfera_services_thumbnails_v0_thumbnails_proto_rawDescData)
|
||||
})
|
||||
return file_qsfera_services_thumbnails_v0_thumbnails_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_qsfera_services_thumbnails_v0_thumbnails_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
|
||||
var file_qsfera_services_thumbnails_v0_thumbnails_proto_goTypes = []interface{}{
|
||||
(*GetThumbnailRequest)(nil), // 0: qsfera.services.thumbnails.v0.GetThumbnailRequest
|
||||
(*GetThumbnailResponse)(nil), // 1: qsfera.services.thumbnails.v0.GetThumbnailResponse
|
||||
(v0.ThumbnailType)(0), // 2: qsfera.messages.thumbnails.v0.ThumbnailType
|
||||
(*v0.WebdavSource)(nil), // 3: qsfera.messages.thumbnails.v0.WebdavSource
|
||||
(*v0.CS3Source)(nil), // 4: qsfera.messages.thumbnails.v0.CS3Source
|
||||
}
|
||||
var file_qsfera_services_thumbnails_v0_thumbnails_proto_depIdxs = []int32{
|
||||
2, // 0: qsfera.services.thumbnails.v0.GetThumbnailRequest.thumbnail_type:type_name -> qsfera.messages.thumbnails.v0.ThumbnailType
|
||||
3, // 1: qsfera.services.thumbnails.v0.GetThumbnailRequest.webdav_source:type_name -> qsfera.messages.thumbnails.v0.WebdavSource
|
||||
4, // 2: qsfera.services.thumbnails.v0.GetThumbnailRequest.cs3_source:type_name -> qsfera.messages.thumbnails.v0.CS3Source
|
||||
0, // 3: qsfera.services.thumbnails.v0.ThumbnailService.GetThumbnail:input_type -> qsfera.services.thumbnails.v0.GetThumbnailRequest
|
||||
1, // 4: qsfera.services.thumbnails.v0.ThumbnailService.GetThumbnail:output_type -> qsfera.services.thumbnails.v0.GetThumbnailResponse
|
||||
4, // [4:5] is the sub-list for method output_type
|
||||
3, // [3:4] is the sub-list for method input_type
|
||||
3, // [3:3] is the sub-list for extension type_name
|
||||
3, // [3:3] is the sub-list for extension extendee
|
||||
0, // [0:3] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_qsfera_services_thumbnails_v0_thumbnails_proto_init() }
|
||||
func file_qsfera_services_thumbnails_v0_thumbnails_proto_init() {
|
||||
if File_qsfera_services_thumbnails_v0_thumbnails_proto != nil {
|
||||
return
|
||||
}
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_qsfera_services_thumbnails_v0_thumbnails_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*GetThumbnailRequest); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_qsfera_services_thumbnails_v0_thumbnails_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*GetThumbnailResponse); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
file_qsfera_services_thumbnails_v0_thumbnails_proto_msgTypes[0].OneofWrappers = []interface{}{
|
||||
(*GetThumbnailRequest_WebdavSource)(nil),
|
||||
(*GetThumbnailRequest_Cs3Source)(nil),
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_qsfera_services_thumbnails_v0_thumbnails_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 2,
|
||||
NumExtensions: 0,
|
||||
NumServices: 1,
|
||||
},
|
||||
GoTypes: file_qsfera_services_thumbnails_v0_thumbnails_proto_goTypes,
|
||||
DependencyIndexes: file_qsfera_services_thumbnails_v0_thumbnails_proto_depIdxs,
|
||||
MessageInfos: file_qsfera_services_thumbnails_v0_thumbnails_proto_msgTypes,
|
||||
}.Build()
|
||||
File_qsfera_services_thumbnails_v0_thumbnails_proto = out.File
|
||||
file_qsfera_services_thumbnails_v0_thumbnails_proto_rawDesc = nil
|
||||
file_qsfera_services_thumbnails_v0_thumbnails_proto_goTypes = nil
|
||||
file_qsfera_services_thumbnails_v0_thumbnails_proto_depIdxs = nil
|
||||
}
|
||||
@@ -0,0 +1,91 @@
|
||||
// Code generated by protoc-gen-micro. DO NOT EDIT.
|
||||
// source: qsfera/services/thumbnails/v0/thumbnails.proto
|
||||
|
||||
package v0
|
||||
|
||||
import (
|
||||
fmt "fmt"
|
||||
_ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options"
|
||||
_ "github.com/qsfera/server/protogen/gen/qsfera/messages/thumbnails/v0"
|
||||
proto "google.golang.org/protobuf/proto"
|
||||
math "math"
|
||||
)
|
||||
|
||||
import (
|
||||
context "context"
|
||||
api "go-micro.dev/v4/api"
|
||||
client "go-micro.dev/v4/client"
|
||||
server "go-micro.dev/v4/server"
|
||||
)
|
||||
|
||||
// Reference imports to suppress errors if they are not otherwise used.
|
||||
var _ = proto.Marshal
|
||||
var _ = fmt.Errorf
|
||||
var _ = math.Inf
|
||||
|
||||
// Reference imports to suppress errors if they are not otherwise used.
|
||||
var _ api.Endpoint
|
||||
var _ context.Context
|
||||
var _ client.Option
|
||||
var _ server.Option
|
||||
|
||||
// Api Endpoints for ThumbnailService service
|
||||
|
||||
func NewThumbnailServiceEndpoints() []*api.Endpoint {
|
||||
return []*api.Endpoint{}
|
||||
}
|
||||
|
||||
// Client API for ThumbnailService service
|
||||
|
||||
type ThumbnailService interface {
|
||||
// Generates the thumbnail and returns it.
|
||||
GetThumbnail(ctx context.Context, in *GetThumbnailRequest, opts ...client.CallOption) (*GetThumbnailResponse, error)
|
||||
}
|
||||
|
||||
type thumbnailService struct {
|
||||
c client.Client
|
||||
name string
|
||||
}
|
||||
|
||||
func NewThumbnailService(name string, c client.Client) ThumbnailService {
|
||||
return &thumbnailService{
|
||||
c: c,
|
||||
name: name,
|
||||
}
|
||||
}
|
||||
|
||||
func (c *thumbnailService) GetThumbnail(ctx context.Context, in *GetThumbnailRequest, opts ...client.CallOption) (*GetThumbnailResponse, error) {
|
||||
req := c.c.NewRequest(c.name, "ThumbnailService.GetThumbnail", in)
|
||||
out := new(GetThumbnailResponse)
|
||||
err := c.c.Call(ctx, req, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// Server API for ThumbnailService service
|
||||
|
||||
type ThumbnailServiceHandler interface {
|
||||
// Generates the thumbnail and returns it.
|
||||
GetThumbnail(context.Context, *GetThumbnailRequest, *GetThumbnailResponse) error
|
||||
}
|
||||
|
||||
func RegisterThumbnailServiceHandler(s server.Server, hdlr ThumbnailServiceHandler, opts ...server.HandlerOption) error {
|
||||
type thumbnailService interface {
|
||||
GetThumbnail(ctx context.Context, in *GetThumbnailRequest, out *GetThumbnailResponse) error
|
||||
}
|
||||
type ThumbnailService struct {
|
||||
thumbnailService
|
||||
}
|
||||
h := &thumbnailServiceHandler{hdlr}
|
||||
return s.Handle(s.NewHandler(&ThumbnailService{h}, opts...))
|
||||
}
|
||||
|
||||
type thumbnailServiceHandler struct {
|
||||
ThumbnailServiceHandler
|
||||
}
|
||||
|
||||
func (h *thumbnailServiceHandler) GetThumbnail(ctx context.Context, in *GetThumbnailRequest, out *GetThumbnailResponse) error {
|
||||
return h.ThumbnailServiceHandler.GetThumbnail(ctx, in, out)
|
||||
}
|
||||
@@ -0,0 +1,129 @@
|
||||
{
|
||||
"swagger": "2.0",
|
||||
"info": {
|
||||
"title": "КуСфера thumbnails",
|
||||
"version": "1.0.0",
|
||||
"contact": {
|
||||
"name": "КуСфера",
|
||||
"url": "",
|
||||
"email": ""
|
||||
},
|
||||
"license": {
|
||||
"name": "Apache-2.0",
|
||||
"url": ""
|
||||
}
|
||||
},
|
||||
"tags": [
|
||||
{
|
||||
"name": "ThumbnailService"
|
||||
}
|
||||
],
|
||||
"schemes": [
|
||||
"http",
|
||||
"https"
|
||||
],
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"paths": {},
|
||||
"definitions": {
|
||||
"protobufAny": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"@type": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"additionalProperties": {}
|
||||
},
|
||||
"rpcStatus": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"code": {
|
||||
"type": "integer",
|
||||
"format": "int32"
|
||||
},
|
||||
"message": {
|
||||
"type": "string"
|
||||
},
|
||||
"details": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/protobufAny"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"v0CS3Source": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"path": {
|
||||
"type": "string"
|
||||
},
|
||||
"authorization": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"v0GetThumbnailResponse": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"dataEndpoint": {
|
||||
"type": "string",
|
||||
"description": "The endpoint where the thumbnail can be downloaded."
|
||||
},
|
||||
"transferToken": {
|
||||
"type": "string",
|
||||
"description": "The transfer token to be able to download the thumbnail."
|
||||
},
|
||||
"mimetype": {
|
||||
"type": "string",
|
||||
"title": "The mimetype of the thumbnail"
|
||||
}
|
||||
},
|
||||
"title": "The service response"
|
||||
},
|
||||
"v0ThumbnailType": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"PNG",
|
||||
"JPG",
|
||||
"GIF"
|
||||
],
|
||||
"default": "PNG",
|
||||
"description": "The file types to which the thumbnail can be encoded to.\n\n - PNG: Represents PNG type\n - JPG: Represents JPG type\n - GIF: Represents GIF type"
|
||||
},
|
||||
"v0WebdavSource": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"url": {
|
||||
"type": "string",
|
||||
"description": "REQUIRED."
|
||||
},
|
||||
"isPublicLink": {
|
||||
"type": "boolean",
|
||||
"description": "REQUIRED."
|
||||
},
|
||||
"webdavAuthorization": {
|
||||
"type": "string",
|
||||
"description": "OPTIONAL."
|
||||
},
|
||||
"revaAuthorization": {
|
||||
"type": "string",
|
||||
"description": "OPTIONAL."
|
||||
},
|
||||
"publicLinkToken": {
|
||||
"type": "string",
|
||||
"description": "OPTIONAL."
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"externalDocs": {
|
||||
"description": "Developer Manual",
|
||||
"url": ""
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,127 @@
|
||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-grpc v1.6.2
|
||||
// - protoc (unknown)
|
||||
// source: qsfera/services/thumbnails/v0/thumbnails.proto
|
||||
|
||||
package v0
|
||||
|
||||
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 (
|
||||
ThumbnailService_GetThumbnail_FullMethodName = "/qsfera.services.thumbnails.v0.ThumbnailService/GetThumbnail"
|
||||
)
|
||||
|
||||
// ThumbnailServiceClient is the client API for ThumbnailService 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.
|
||||
//
|
||||
// A Service for handling thumbnail generation
|
||||
type ThumbnailServiceClient interface {
|
||||
// Generates the thumbnail and returns it.
|
||||
GetThumbnail(ctx context.Context, in *GetThumbnailRequest, opts ...grpc.CallOption) (*GetThumbnailResponse, error)
|
||||
}
|
||||
|
||||
type thumbnailServiceClient struct {
|
||||
cc grpc.ClientConnInterface
|
||||
}
|
||||
|
||||
func NewThumbnailServiceClient(cc grpc.ClientConnInterface) ThumbnailServiceClient {
|
||||
return &thumbnailServiceClient{cc}
|
||||
}
|
||||
|
||||
func (c *thumbnailServiceClient) GetThumbnail(ctx context.Context, in *GetThumbnailRequest, opts ...grpc.CallOption) (*GetThumbnailResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(GetThumbnailResponse)
|
||||
err := c.cc.Invoke(ctx, ThumbnailService_GetThumbnail_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// ThumbnailServiceServer is the server API for ThumbnailService service.
|
||||
// All implementations must embed UnimplementedThumbnailServiceServer
|
||||
// for forward compatibility.
|
||||
//
|
||||
// A Service for handling thumbnail generation
|
||||
type ThumbnailServiceServer interface {
|
||||
// Generates the thumbnail and returns it.
|
||||
GetThumbnail(context.Context, *GetThumbnailRequest) (*GetThumbnailResponse, error)
|
||||
mustEmbedUnimplementedThumbnailServiceServer()
|
||||
}
|
||||
|
||||
// UnimplementedThumbnailServiceServer 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 UnimplementedThumbnailServiceServer struct{}
|
||||
|
||||
func (UnimplementedThumbnailServiceServer) GetThumbnail(context.Context, *GetThumbnailRequest) (*GetThumbnailResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method GetThumbnail not implemented")
|
||||
}
|
||||
func (UnimplementedThumbnailServiceServer) mustEmbedUnimplementedThumbnailServiceServer() {}
|
||||
func (UnimplementedThumbnailServiceServer) testEmbeddedByValue() {}
|
||||
|
||||
// UnsafeThumbnailServiceServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to ThumbnailServiceServer will
|
||||
// result in compilation errors.
|
||||
type UnsafeThumbnailServiceServer interface {
|
||||
mustEmbedUnimplementedThumbnailServiceServer()
|
||||
}
|
||||
|
||||
func RegisterThumbnailServiceServer(s grpc.ServiceRegistrar, srv ThumbnailServiceServer) {
|
||||
// If the following call panics, it indicates UnimplementedThumbnailServiceServer 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(&ThumbnailService_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
func _ThumbnailService_GetThumbnail_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetThumbnailRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ThumbnailServiceServer).GetThumbnail(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: ThumbnailService_GetThumbnail_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ThumbnailServiceServer).GetThumbnail(ctx, req.(*GetThumbnailRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
// ThumbnailService_ServiceDesc is the grpc.ServiceDesc for ThumbnailService service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
var ThumbnailService_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "qsfera.services.thumbnails.v0.ThumbnailService",
|
||||
HandlerType: (*ThumbnailServiceServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "GetThumbnail",
|
||||
Handler: _ThumbnailService_GetThumbnail_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "qsfera/services/thumbnails/v0/thumbnails.proto",
|
||||
}
|
||||
Reference in New Issue
Block a user