Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
perxis-go
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Package registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
perxis
perxis-go
Commits
abd388a1
Commit
abd388a1
authored
6 months ago
by
Semyon Krestyaninov
Browse files
Options
Downloads
Patches
Plain Diff
fix
parent
9eb24e8f
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
images/service.go
+3
-3
3 additions, 3 deletions
images/service.go
images/transport/grpc/protobuf_type_converters.microgen.go
+39
-9
39 additions, 9 deletions
images/transport/grpc/protobuf_type_converters.microgen.go
proto/images/images.pb.go
+9
-9
9 additions, 9 deletions
proto/images/images.pb.go
with
51 additions
and
21 deletions
images/service.go
+
3
−
3
View file @
abd388a1
...
@@ -26,9 +26,9 @@ type GetOptions struct {
...
@@ -26,9 +26,9 @@ type GetOptions struct {
}
}
type
Command
struct
{
type
Command
struct
{
Crop
Command
*
CropCommand
Crop
*
CropCommand
Fit
Command
*
FitCommand
Fit
*
FitCommand
Resize
Command
*
ResizeCommand
Resize
*
ResizeCommand
}
}
type
CropCommand
struct
{
type
CropCommand
struct
{
...
...
This diff is collapsed.
Click to expand it.
images/transport/grpc/protobuf_type_converters.microgen.go
+
39
−
9
View file @
abd388a1
...
@@ -88,19 +88,31 @@ func ProtoToPtrGetOptions(protoOpts *pbimage.GetRequest_GetOptions) (*service.Ge
...
@@ -88,19 +88,31 @@ func ProtoToPtrGetOptions(protoOpts *pbimage.GetRequest_GetOptions) (*service.Ge
}
}
func
ProtoCommandToPtr
(
cmd
*
pbimage
.
Command
)
*
service
.
Command
{
func
ProtoCommandToPtr
(
cmd
*
pbimage
.
Command
)
*
service
.
Command
{
if
cmd
==
nil
{
return
nil
}
switch
cmd
.
GetCommandType
()
.
(
type
)
{
switch
cmd
.
GetCommandType
()
.
(
type
)
{
case
*
pbimage
.
Command_Crop
:
case
*
pbimage
.
Command_Crop
:
return
&
service
.
Command
{
CropCommand
:
ProtoCropCommandToPtr
(
cmd
.
GetCrop
())}
return
&
service
.
Command
{
Crop
:
ProtoCropCommandToPtr
(
cmd
.
GetCrop
()),
}
case
*
pbimage
.
Command_Fit
:
case
*
pbimage
.
Command_Fit
:
return
&
service
.
Command
{
FitCommand
:
ProtoFitCommandToPtr
(
cmd
.
GetFit
())}
return
&
service
.
Command
{
Fit
:
ProtoFitCommandToPtr
(
cmd
.
GetFit
()),
}
case
*
pbimage
.
Command_Resize
:
case
*
pbimage
.
Command_Resize
:
return
&
service
.
Command
{
ResizeCommand
:
ProtoResizeCommandToPtr
(
cmd
.
GetResize
())}
return
&
service
.
Command
{
Resize
:
ProtoResizeCommandToPtr
(
cmd
.
GetResize
()),
}
default
:
default
:
return
nil
return
nil
}
}
}
}
func
ProtoCropCommandToPtr
(
cmd
*
pbimage
.
CropCommand
)
*
service
.
CropCommand
{
func
ProtoCropCommandToPtr
(
cmd
*
pbimage
.
CropCommand
)
*
service
.
CropCommand
{
if
cmd
==
nil
{
return
nil
}
return
&
service
.
CropCommand
{
return
&
service
.
CropCommand
{
Width
:
int
(
cmd
.
Width
),
Width
:
int
(
cmd
.
Width
),
Height
:
int
(
cmd
.
Height
),
Height
:
int
(
cmd
.
Height
),
...
@@ -109,6 +121,9 @@ func ProtoCropCommandToPtr(cmd *pbimage.CropCommand) *service.CropCommand {
...
@@ -109,6 +121,9 @@ func ProtoCropCommandToPtr(cmd *pbimage.CropCommand) *service.CropCommand {
}
}
func
ProtoFitCommandToPtr
(
cmd
*
pbimage
.
FitCommand
)
*
service
.
FitCommand
{
func
ProtoFitCommandToPtr
(
cmd
*
pbimage
.
FitCommand
)
*
service
.
FitCommand
{
if
cmd
==
nil
{
return
nil
}
return
&
service
.
FitCommand
{
return
&
service
.
FitCommand
{
Width
:
int
(
cmd
.
Width
),
Width
:
int
(
cmd
.
Width
),
Height
:
int
(
cmd
.
Height
),
Height
:
int
(
cmd
.
Height
),
...
@@ -117,6 +132,9 @@ func ProtoFitCommandToPtr(cmd *pbimage.FitCommand) *service.FitCommand {
...
@@ -117,6 +132,9 @@ func ProtoFitCommandToPtr(cmd *pbimage.FitCommand) *service.FitCommand {
}
}
func
ProtoResizeCommandToPtr
(
cmd
*
pbimage
.
ResizeCommand
)
*
service
.
ResizeCommand
{
func
ProtoResizeCommandToPtr
(
cmd
*
pbimage
.
ResizeCommand
)
*
service
.
ResizeCommand
{
if
cmd
==
nil
{
return
nil
}
return
&
service
.
ResizeCommand
{
return
&
service
.
ResizeCommand
{
Width
:
int
(
cmd
.
Width
),
Width
:
int
(
cmd
.
Width
),
Height
:
int
(
cmd
.
Height
),
Height
:
int
(
cmd
.
Height
),
...
@@ -125,23 +143,26 @@ func ProtoResizeCommandToPtr(cmd *pbimage.ResizeCommand) *service.ResizeCommand
...
@@ -125,23 +143,26 @@ func ProtoResizeCommandToPtr(cmd *pbimage.ResizeCommand) *service.ResizeCommand
}
}
func
PtrCommandToProto
(
cmd
*
service
.
Command
)
*
pbimage
.
Command
{
func
PtrCommandToProto
(
cmd
*
service
.
Command
)
*
pbimage
.
Command
{
if
cmd
==
nil
{
return
nil
}
switch
{
switch
{
case
cmd
.
Crop
Command
!=
nil
:
case
cmd
.
Crop
!=
nil
:
return
&
pbimage
.
Command
{
return
&
pbimage
.
Command
{
CommandType
:
&
pbimage
.
Command_Crop
{
CommandType
:
&
pbimage
.
Command_Crop
{
Crop
:
PtrCropCommandToProto
(
cmd
.
Crop
Command
),
Crop
:
PtrCropCommandToProto
(
cmd
.
Crop
),
},
},
}
}
case
cmd
.
Fit
Command
!=
nil
:
case
cmd
.
Fit
!=
nil
:
return
&
pbimage
.
Command
{
return
&
pbimage
.
Command
{
CommandType
:
&
pbimage
.
Command_Fit
{
CommandType
:
&
pbimage
.
Command_Fit
{
Fit
:
PtrFitCommandToProto
(
cmd
.
Fit
Command
),
Fit
:
PtrFitCommandToProto
(
cmd
.
Fit
),
},
},
}
}
case
cmd
.
Resize
Command
!=
nil
:
case
cmd
.
Resize
!=
nil
:
return
&
pbimage
.
Command
{
return
&
pbimage
.
Command
{
CommandType
:
&
pbimage
.
Command_Resize
{
CommandType
:
&
pbimage
.
Command_Resize
{
Resize
:
PtrResizeCommandToProto
(
cmd
.
Resize
Command
),
Resize
:
PtrResizeCommandToProto
(
cmd
.
Resize
),
},
},
}
}
default
:
default
:
...
@@ -150,6 +171,9 @@ func PtrCommandToProto(cmd *service.Command) *pbimage.Command {
...
@@ -150,6 +171,9 @@ func PtrCommandToProto(cmd *service.Command) *pbimage.Command {
}
}
func
PtrCropCommandToProto
(
cmd
*
service
.
CropCommand
)
*
pbimage
.
CropCommand
{
func
PtrCropCommandToProto
(
cmd
*
service
.
CropCommand
)
*
pbimage
.
CropCommand
{
if
cmd
==
nil
{
return
nil
}
return
&
pbimage
.
CropCommand
{
return
&
pbimage
.
CropCommand
{
Width
:
int64
(
cmd
.
Width
),
Width
:
int64
(
cmd
.
Width
),
Height
:
int64
(
cmd
.
Height
),
Height
:
int64
(
cmd
.
Height
),
...
@@ -158,6 +182,9 @@ func PtrCropCommandToProto(cmd *service.CropCommand) *pbimage.CropCommand {
...
@@ -158,6 +182,9 @@ func PtrCropCommandToProto(cmd *service.CropCommand) *pbimage.CropCommand {
}
}
func
PtrFitCommandToProto
(
cmd
*
service
.
FitCommand
)
*
pbimage
.
FitCommand
{
func
PtrFitCommandToProto
(
cmd
*
service
.
FitCommand
)
*
pbimage
.
FitCommand
{
if
cmd
==
nil
{
return
nil
}
return
&
pbimage
.
FitCommand
{
return
&
pbimage
.
FitCommand
{
Width
:
int64
(
cmd
.
Width
),
Width
:
int64
(
cmd
.
Width
),
Height
:
int64
(
cmd
.
Height
),
Height
:
int64
(
cmd
.
Height
),
...
@@ -166,6 +193,9 @@ func PtrFitCommandToProto(cmd *service.FitCommand) *pbimage.FitCommand {
...
@@ -166,6 +193,9 @@ func PtrFitCommandToProto(cmd *service.FitCommand) *pbimage.FitCommand {
}
}
func
PtrResizeCommandToProto
(
cmd
*
service
.
ResizeCommand
)
*
pbimage
.
ResizeCommand
{
func
PtrResizeCommandToProto
(
cmd
*
service
.
ResizeCommand
)
*
pbimage
.
ResizeCommand
{
if
cmd
==
nil
{
return
nil
}
return
&
pbimage
.
ResizeCommand
{
return
&
pbimage
.
ResizeCommand
{
Width
:
int64
(
cmd
.
Width
),
Width
:
int64
(
cmd
.
Width
),
Height
:
int64
(
cmd
.
Height
),
Height
:
int64
(
cmd
.
Height
),
...
...
This diff is collapsed.
Click to expand it.
proto/images/images.pb.go
+
9
−
9
View file @
abd388a1
...
@@ -56,7 +56,7 @@ func (x *CropCommand) ProtoReflect() protoreflect.Message {
...
@@ -56,7 +56,7 @@ func (x *CropCommand) ProtoReflect() protoreflect.Message {
return
mi
.
MessageOf
(
x
)
return
mi
.
MessageOf
(
x
)
}
}
// Deprecated: Use Crop
Command
.ProtoReflect.Descriptor instead.
// Deprecated: Use Crop.ProtoReflect.Descriptor instead.
func
(
*
CropCommand
)
Descriptor
()
([]
byte
,
[]
int
)
{
func
(
*
CropCommand
)
Descriptor
()
([]
byte
,
[]
int
)
{
return
file_images_images_proto_rawDescGZIP
(),
[]
int
{
0
}
return
file_images_images_proto_rawDescGZIP
(),
[]
int
{
0
}
}
}
...
@@ -117,7 +117,7 @@ func (x *FitCommand) ProtoReflect() protoreflect.Message {
...
@@ -117,7 +117,7 @@ func (x *FitCommand) ProtoReflect() protoreflect.Message {
return
mi
.
MessageOf
(
x
)
return
mi
.
MessageOf
(
x
)
}
}
// Deprecated: Use Fit
Command
.ProtoReflect.Descriptor instead.
// Deprecated: Use Fit.ProtoReflect.Descriptor instead.
func
(
*
FitCommand
)
Descriptor
()
([]
byte
,
[]
int
)
{
func
(
*
FitCommand
)
Descriptor
()
([]
byte
,
[]
int
)
{
return
file_images_images_proto_rawDescGZIP
(),
[]
int
{
1
}
return
file_images_images_proto_rawDescGZIP
(),
[]
int
{
1
}
}
}
...
@@ -178,7 +178,7 @@ func (x *ResizeCommand) ProtoReflect() protoreflect.Message {
...
@@ -178,7 +178,7 @@ func (x *ResizeCommand) ProtoReflect() protoreflect.Message {
return
mi
.
MessageOf
(
x
)
return
mi
.
MessageOf
(
x
)
}
}
// Deprecated: Use Resize
Command
.ProtoReflect.Descriptor instead.
// Deprecated: Use Resize.ProtoReflect.Descriptor instead.
func
(
*
ResizeCommand
)
Descriptor
()
([]
byte
,
[]
int
)
{
func
(
*
ResizeCommand
)
Descriptor
()
([]
byte
,
[]
int
)
{
return
file_images_images_proto_rawDescGZIP
(),
[]
int
{
2
}
return
file_images_images_proto_rawDescGZIP
(),
[]
int
{
2
}
}
}
...
@@ -579,9 +579,9 @@ func file_images_images_proto_rawDescGZIP() []byte {
...
@@ -579,9 +579,9 @@ func file_images_images_proto_rawDescGZIP() []byte {
var
file_images_images_proto_msgTypes
=
make
([]
protoimpl
.
MessageInfo
,
7
)
var
file_images_images_proto_msgTypes
=
make
([]
protoimpl
.
MessageInfo
,
7
)
var
file_images_images_proto_goTypes
=
[]
any
{
var
file_images_images_proto_goTypes
=
[]
any
{
(
*
CropCommand
)(
nil
),
// 0: images.Crop
Command
(
*
CropCommand
)(
nil
),
// 0: images.Crop
(
*
FitCommand
)(
nil
),
// 1: images.Fit
Command
(
*
FitCommand
)(
nil
),
// 1: images.Fit
(
*
ResizeCommand
)(
nil
),
// 2: images.Resize
Command
(
*
ResizeCommand
)(
nil
),
// 2: images.Resize
(
*
Command
)(
nil
),
// 3: images.Command
(
*
Command
)(
nil
),
// 3: images.Command
(
*
GetRequest
)(
nil
),
// 4: images.GetRequest
(
*
GetRequest
)(
nil
),
// 4: images.GetRequest
(
*
GetResponse
)(
nil
),
// 5: images.GetResponse
(
*
GetResponse
)(
nil
),
// 5: images.GetResponse
...
@@ -589,9 +589,9 @@ var file_images_images_proto_goTypes = []any{
...
@@ -589,9 +589,9 @@ var file_images_images_proto_goTypes = []any{
(
*
files
.
File
)(
nil
),
// 7: files.File
(
*
files
.
File
)(
nil
),
// 7: files.File
}
}
var
file_images_images_proto_depIdxs
=
[]
int32
{
var
file_images_images_proto_depIdxs
=
[]
int32
{
0
,
// 0: images.Command.crop:type_name -> images.Crop
Command
0
,
// 0: images.Command.crop:type_name -> images.Crop
1
,
// 1: images.Command.fit:type_name -> images.Fit
Command
1
,
// 1: images.Command.fit:type_name -> images.Fit
2
,
// 2: images.Command.resize:type_name -> images.Resize
Command
2
,
// 2: images.Command.resize:type_name -> images.Resize
7
,
// 3: images.GetRequest.source:type_name -> files.File
7
,
// 3: images.GetRequest.source:type_name -> files.File
6
,
// 4: images.GetRequest.opts:type_name -> images.GetRequest.GetOptions
6
,
// 4: images.GetRequest.opts:type_name -> images.GetRequest.GetOptions
7
,
// 5: images.GetResponse.result:type_name -> files.File
7
,
// 5: images.GetResponse.result:type_name -> files.File
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment