buf: protobuf now used managed mode

This commit is contained in:
Tigor Hutasuhut 2024-08-16 11:44:31 +07:00
parent 37ca5f54bc
commit 02720647a8
24 changed files with 12 additions and 44 deletions

View file

@ -20,8 +20,8 @@ import (
"github.com/stephenafamo/bob"
"github.com/tigorlazuardi/bluemage/go/api"
"github.com/tigorlazuardi/bluemage/go/config"
v1DeviceConnect "github.com/tigorlazuardi/bluemage/go/gen/proto/device/v1/v1connect"
v1SubredditsConnect "github.com/tigorlazuardi/bluemage/go/gen/proto/subreddits/v1/v1connect"
v1DeviceConnect "github.com/tigorlazuardi/bluemage/go/gen/proto/device/v1/devicev1connect"
v1SubredditsConnect "github.com/tigorlazuardi/bluemage/go/gen/proto/subreddits/v1/subredditsv1connect"
"github.com/tigorlazuardi/bluemage/go/gen/reddit"
"github.com/tigorlazuardi/bluemage/go/pkg/errs"
"github.com/tigorlazuardi/bluemage/go/pkg/log"

View file

@ -7,7 +7,7 @@ import (
"github.com/tigorlazuardi/bluemage/go/api"
"github.com/tigorlazuardi/bluemage/go/gen/converter"
device "github.com/tigorlazuardi/bluemage/go/gen/proto/device/v1"
"github.com/tigorlazuardi/bluemage/go/gen/proto/device/v1/v1connect"
v1connect "github.com/tigorlazuardi/bluemage/go/gen/proto/device/v1/devicev1connect"
"github.com/tigorlazuardi/bluemage/go/pkg/errs"
)

View file

@ -8,7 +8,7 @@ import (
"github.com/tigorlazuardi/bluemage/go/api"
"github.com/tigorlazuardi/bluemage/go/gen/converter"
subreddits "github.com/tigorlazuardi/bluemage/go/gen/proto/subreddits/v1"
"github.com/tigorlazuardi/bluemage/go/gen/proto/subreddits/v1/v1connect"
v1connect "github.com/tigorlazuardi/bluemage/go/gen/proto/subreddits/v1/subredditsv1connect"
"github.com/tigorlazuardi/bluemage/go/pkg/errs"
)

View file

@ -1,4 +1,12 @@
version: v2
managed:
enabled: true
disable:
- module: buf.build/bufbuild/protovalidate
override:
- file_option: go_package_prefix
value: github.com/tigorlazuardi/bluemage/go/gen/proto
plugins:
- local: protoc-gen-go
out: ../../go/gen/proto

View file

@ -4,8 +4,6 @@ package device.v1;
import "device/v1/list.proto";
option go_package = "github.com/tigorlazuardi/bluemage/go/gen/proto/device/v1";
message CountDevicesRequest {
// Limits the counts to devices that contains the given name.
// case insensitive.

View file

@ -4,8 +4,6 @@ package device.v1;
import "buf/validate/validate.proto";
option go_package = "github.com/tigorlazuardi/bluemage/go/gen/proto/device/v1";
message CreateDeviceRequest {
// The `slug` is a unique identifier for the device, used to identify the device within the system.
// Each `slug` must be unique across all devices.

View file

@ -9,8 +9,6 @@ import "device/v1/get.proto";
import "device/v1/list.proto";
import "device/v1/update.proto";
option go_package = "github.com/tigorlazuardi/bluemage/go/gen/proto/device/v1";
service DeviceService {
// GetDevice fetches a device by its slug.
//

View file

@ -4,8 +4,6 @@ package device.v1;
import "buf/validate/validate.proto";
option go_package = "github.com/tigorlazuardi/bluemage/go/gen/proto/device/v1";
message DeviceExistsRequest {
// The `slug` is a unique identifier for the device.
string slug = 1 [(buf.validate.field).string.min_len = 1];

View file

@ -5,8 +5,6 @@ package device.v1;
import "buf/validate/validate.proto";
import "device/v1/types.proto";
option go_package = "github.com/tigorlazuardi/bluemage/go/gen/proto/device/v1";
message GetDeviceRequest {
// The `slug` is a unique identifier for the device.
string slug = 1 [(buf.validate.field).string.min_len = 1];

View file

@ -4,8 +4,6 @@ package device.v1;
import "device/v1/types.proto";
option go_package = "github.com/tigorlazuardi/bluemage/go/gen/proto/device/v1";
message ListDevicesRequest {
// searches the name and slug of the devices.
// case insensitive.

View file

@ -2,8 +2,6 @@ syntax = "proto3";
package device.v1;
option go_package = "github.com/tigorlazuardi/bluemage/go/gen/proto/device/v1";
message Device {
string slug = 1;
bool disabled = 2;

View file

@ -4,8 +4,6 @@ package device.v1;
import "buf/validate/validate.proto";
option go_package = "github.com/tigorlazuardi/bluemage/go/gen/proto/device/v1";
message UpdateDeviceRequest {
string slug = 1 [(buf.validate.field).string.min_len = 1];
DeviceSetter set = 2;

View file

@ -5,8 +5,6 @@ package images.v1;
import "buf/validate/validate.proto";
import "images/v1/types.proto";
option go_package = "github.com/tigorlazuardi/bluemage/go/gen/proto/images/v1";
service ImageService {
rpc RecentlyAddedImages(RecentlyAddedImagesRequest) returns (RecentlyAddedImagesResponse) {}
}

View file

@ -2,8 +2,6 @@ syntax = "proto3";
package images.v1;
option go_package = "github.com/tigorlazuardi/bluemage/go/gen/proto/images/v1";
message Image {
int32 id = 1;
string subreddit = 2;

View file

@ -4,8 +4,6 @@ package subreddits.v1;
import "subreddits/v1/types.proto";
option go_package = "github.com/tigorlazuardi/bluemage/go/gen/proto/subreddits/v1";
message CountSubredditsRequest {
// Limits the counts to subreddits that contains the given name.
// case insensitive.

View file

@ -5,8 +5,6 @@ package subreddits.v1;
import "buf/validate/validate.proto";
import "subreddits/v1/types.proto";
option go_package = "github.com/tigorlazuardi/bluemage/go/gen/proto/subreddits/v1";
message CreateSubredditRequest {
// name of the subreddits to insert.
//

View file

@ -4,8 +4,6 @@ package subreddits.v1;
import "buf/validate/validate.proto";
option go_package = "github.com/tigorlazuardi/bluemage/go/gen/proto/subreddits/v1";
message DeleteSubredditRequest {
// name of the subreddit to delete
string name = 1 [(buf.validate.field).string.min_len = 1];

View file

@ -4,8 +4,6 @@ package subreddits.v1;
import "buf/validate/validate.proto";
option go_package = "github.com/tigorlazuardi/bluemage/go/gen/proto/subreddits/v1";
message SubredditExistsRequest {
// name of the subreddit. Case insensitive.
string name = 1 [(buf.validate.field).string.min_len = 1];

View file

@ -5,8 +5,6 @@ package subreddits.v1;
import "buf/validate/validate.proto";
import "subreddits/v1/types.proto";
option go_package = "github.com/tigorlazuardi/bluemage/go/gen/proto/subreddits/v1";
message GetSubredditRequest {
// name of the subreddit. Case insensitive.
//

View file

@ -4,8 +4,6 @@ package subreddits.v1;
import "subreddits/v1/types.proto";
option go_package = "github.com/tigorlazuardi/bluemage/go/gen/proto/subreddits/v1";
message ListSubredditsRequest {
// Searches the name of the Subreddit.
// case insensitive.

View file

@ -5,8 +5,6 @@ package subreddits.v1;
import "buf/validate/validate.proto";
import "subreddits/v1/types.proto";
option go_package = "github.com/tigorlazuardi/bluemage/go/gen/proto/subreddits/v1";
message ResolveSubredditNameRequest {
// name of the subreddit to resolve (check existence and casing).
string name = 1 [(buf.validate.field).string.min_len = 1];

View file

@ -11,8 +11,6 @@ import "subreddits/v1/list.proto";
import "subreddits/v1/resolve.proto";
import "subreddits/v1/update.proto";
option go_package = "github.com/tigorlazuardi/bluemage/go/gen/proto/subreddits/v1";
service SubredditsService {
// CreateSubreddit creates a new subreddit
//

View file

@ -2,8 +2,6 @@ syntax = "proto3";
package subreddits.v1;
option go_package = "github.com/tigorlazuardi/bluemage/go/gen/proto/subreddits/v1";
message Subreddit {
string name = 1;
bool disabled = 2;

View file

@ -4,8 +4,6 @@ package subreddits.v1;
import "buf/validate/validate.proto";
option go_package = "github.com/tigorlazuardi/bluemage/go/gen/proto/subreddits/v1";
message UpdateSubredditRequest {
// The name of the subreddit to update.
string name = 1 [(buf.validate.field).string.min_len = 1];