-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Updated protos and refactored code to work with new protos #14
Conversation
go-cover-viewgithub.com/azarc-io/vth-faas-sdk-go/pkg/spark/v1/codec.go
github.com/azarc-io/vth-faas-sdk-go/pkg/spark/v1/errors.go
github.com/azarc-io/vth-faas-sdk-go/pkg/spark/v1/executor.go
github.com/azarc-io/vth-faas-sdk-go/pkg/spark/v1/extensions.go
github.com/azarc-io/vth-faas-sdk-go/pkg/spark/v1/helpers.go
github.com/azarc-io/vth-faas-sdk-go/pkg/spark/v1/io_grpc.go
github.com/azarc-io/vth-faas-sdk-go/pkg/spark/v1/io_memory.go
github.com/azarc-io/vth-faas-sdk-go/pkg/spark/v1/progress_grpc.go
github.com/azarc-io/vth-faas-sdk-go/pkg/spark/v1/progress_memory.go
github.com/azarc-io/vth-faas-sdk-go/pkg/spark/v1/server.go
github.com/azarc-io/vth-faas-sdk-go/pkg/spark/v1/variable.go
|
1 similar comment
go-cover-viewgithub.com/azarc-io/vth-faas-sdk-go/pkg/spark/v1/codec.go
github.com/azarc-io/vth-faas-sdk-go/pkg/spark/v1/errors.go
github.com/azarc-io/vth-faas-sdk-go/pkg/spark/v1/executor.go
github.com/azarc-io/vth-faas-sdk-go/pkg/spark/v1/extensions.go
github.com/azarc-io/vth-faas-sdk-go/pkg/spark/v1/helpers.go
github.com/azarc-io/vth-faas-sdk-go/pkg/spark/v1/io_grpc.go
github.com/azarc-io/vth-faas-sdk-go/pkg/spark/v1/io_memory.go
github.com/azarc-io/vth-faas-sdk-go/pkg/spark/v1/progress_grpc.go
github.com/azarc-io/vth-faas-sdk-go/pkg/spark/v1/progress_memory.go
github.com/azarc-io/vth-faas-sdk-go/pkg/spark/v1/server.go
github.com/azarc-io/vth-faas-sdk-go/pkg/spark/v1/variable.go
|
go-cover-viewgithub.com/azarc-io/vth-faas-sdk-go/pkg/spark/v1/codec.go
github.com/azarc-io/vth-faas-sdk-go/pkg/spark/v1/errors.go
github.com/azarc-io/vth-faas-sdk-go/pkg/spark/v1/executor.go
github.com/azarc-io/vth-faas-sdk-go/pkg/spark/v1/extensions.go
github.com/azarc-io/vth-faas-sdk-go/pkg/spark/v1/helpers.go
github.com/azarc-io/vth-faas-sdk-go/pkg/spark/v1/io_grpc.go
github.com/azarc-io/vth-faas-sdk-go/pkg/spark/v1/io_memory.go
github.com/azarc-io/vth-faas-sdk-go/pkg/spark/v1/progress_grpc.go
github.com/azarc-io/vth-faas-sdk-go/pkg/spark/v1/progress_memory.go
github.com/azarc-io/vth-faas-sdk-go/pkg/spark/v1/server.go
github.com/azarc-io/vth-faas-sdk-go/pkg/spark/v1/variable.go
|
@@ -1,108 +1,72 @@ | |||
package sparkv1 | |||
|
|||
import ( | |||
"encoding/json" | |||
"google.golang.org/protobuf/types/known/structpb" | |||
jsoniter "github.com/json-iterator/go" | |||
) | |||
|
|||
const ( | |||
NoMimeType = "" | |||
MimeTypeJSON = "application/json" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should these not be in a const global as im sure they will be used across everywhere
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would rather not create multiple packages for the developer to deal with and developer can put in any mime type they want, it's a plain string, we don't really need to provide them with a constant as they can define any mime type. The reason those are there is because of that extension, but I will update this PR to delete that extension I don't think we even need it anymore because the data coming in is now bytes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but surely there is a lib or something that defines all the common mimetypes? Just hate seeing this same constant defined everywhere, its annoying for developers to always remember the different quirky ways someone typed the const name.
pkg/spark/v1/codec.go
Outdated
|
||
func UnmarshalBinaryTo(data []byte, out interface{}, mimeType string) error { | ||
if mimeType == "" { | ||
return sparkv1.SerdesMap[MimeTypeJSON].Unmarshal(data, &out) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
where is this defined? MimeTypeJSON
pkg/spark/v1/variable.go
Outdated
@@ -3,9 +3,9 @@ package spark_v1 | |||
type Var struct { | |||
Name string | |||
MimeType string | |||
Value any | |||
Value interface{} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why use interface{}
over any
?
go-cover-viewgithub.com/azarc-io/vth-faas-sdk-go/pkg/spark/v1/errors.go
github.com/azarc-io/vth-faas-sdk-go/pkg/spark/v1/executor.go
github.com/azarc-io/vth-faas-sdk-go/pkg/spark/v1/extensions.go
github.com/azarc-io/vth-faas-sdk-go/pkg/spark/v1/helpers.go
github.com/azarc-io/vth-faas-sdk-go/pkg/spark/v1/io_grpc.go
github.com/azarc-io/vth-faas-sdk-go/pkg/spark/v1/io_memory.go
github.com/azarc-io/vth-faas-sdk-go/pkg/spark/v1/progress_grpc.go
github.com/azarc-io/vth-faas-sdk-go/pkg/spark/v1/progress_memory.go
github.com/azarc-io/vth-faas-sdk-go/pkg/spark/v1/server.go
|
No description provided.