-
Notifications
You must be signed in to change notification settings - Fork 77
Open
Description
Thank you for the library.
Consider generating device/os/browser types from a proto file. Proto enums are easily upgraded should new device/os/browser coverage be needed. They also present the advantage of being referenced by other definitions. Take google/protobuf/empty.proto for example. A simple empty proto easy to create but referenced by many. Or google/protobuf/timestamp.proto. It is commonly used because it ensures a timestamp with milliseconds and/or nanoseconds precision is parsed around between services needing it. It would be good to parse these device/os/browser types as types and not as strings. Users not needing the proto definitions can continue to use the library as usual.
types
| -> device
| -> device.go
| -> device.proto
| -> device.pb.go
| -> os
...
device.go
type Device struct {
device DeviceType // from proto
version string // or struct with major(), minor(), patch()
}device.proto
syntax = "proto3";
option go_package = "github.com/avct/uasurfer/types/device";
enum DeviceType {
unknown = 0;
...
};or Device type can be a message
syntax = "proto3";
option go_package = "github.com/avct/uasurfer/types/device";
message Device {
DeviceType deviceType = 1;
Version version = 2;
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels