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/stephenafamo/bob"
"github.com/tigorlazuardi/bluemage/go/api" "github.com/tigorlazuardi/bluemage/go/api"
"github.com/tigorlazuardi/bluemage/go/config" "github.com/tigorlazuardi/bluemage/go/config"
v1DeviceConnect "github.com/tigorlazuardi/bluemage/go/gen/proto/device/v1/v1connect" v1DeviceConnect "github.com/tigorlazuardi/bluemage/go/gen/proto/device/v1/devicev1connect"
v1SubredditsConnect "github.com/tigorlazuardi/bluemage/go/gen/proto/subreddits/v1/v1connect" v1SubredditsConnect "github.com/tigorlazuardi/bluemage/go/gen/proto/subreddits/v1/subredditsv1connect"
"github.com/tigorlazuardi/bluemage/go/gen/reddit" "github.com/tigorlazuardi/bluemage/go/gen/reddit"
"github.com/tigorlazuardi/bluemage/go/pkg/errs" "github.com/tigorlazuardi/bluemage/go/pkg/errs"
"github.com/tigorlazuardi/bluemage/go/pkg/log" "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/api"
"github.com/tigorlazuardi/bluemage/go/gen/converter" "github.com/tigorlazuardi/bluemage/go/gen/converter"
device "github.com/tigorlazuardi/bluemage/go/gen/proto/device/v1" 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" "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/api"
"github.com/tigorlazuardi/bluemage/go/gen/converter" "github.com/tigorlazuardi/bluemage/go/gen/converter"
subreddits "github.com/tigorlazuardi/bluemage/go/gen/proto/subreddits/v1" 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" "github.com/tigorlazuardi/bluemage/go/pkg/errs"
) )

View file

@ -1,4 +1,12 @@
version: v2 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: plugins:
- local: protoc-gen-go - local: protoc-gen-go
out: ../../go/gen/proto out: ../../go/gen/proto

View file

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

View file

@ -4,8 +4,6 @@ package device.v1;
import "buf/validate/validate.proto"; import "buf/validate/validate.proto";
option go_package = "github.com/tigorlazuardi/bluemage/go/gen/proto/device/v1";
message CreateDeviceRequest { message CreateDeviceRequest {
// The `slug` is a unique identifier for the device, used to identify the device within the system. // 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. // 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/list.proto";
import "device/v1/update.proto"; import "device/v1/update.proto";
option go_package = "github.com/tigorlazuardi/bluemage/go/gen/proto/device/v1";
service DeviceService { service DeviceService {
// GetDevice fetches a device by its slug. // GetDevice fetches a device by its slug.
// //

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -5,8 +5,6 @@ package subreddits.v1;
import "buf/validate/validate.proto"; import "buf/validate/validate.proto";
import "subreddits/v1/types.proto"; import "subreddits/v1/types.proto";
option go_package = "github.com/tigorlazuardi/bluemage/go/gen/proto/subreddits/v1";
message ResolveSubredditNameRequest { message ResolveSubredditNameRequest {
// name of the subreddit to resolve (check existence and casing). // name of the subreddit to resolve (check existence and casing).
string name = 1 [(buf.validate.field).string.min_len = 1]; 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/resolve.proto";
import "subreddits/v1/update.proto"; import "subreddits/v1/update.proto";
option go_package = "github.com/tigorlazuardi/bluemage/go/gen/proto/subreddits/v1";
service SubredditsService { service SubredditsService {
// CreateSubreddit creates a new subreddit // CreateSubreddit creates a new subreddit
// //

View file

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

View file

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