1
0
mirror of https://github.com/Mrs4s/MiraiGo.git synced 2025-05-04 19:17:38 +08:00

update protobuf/Makefile

This commit is contained in:
wdvxdr 2022-05-24 11:14:36 +08:00
parent 5b616d65f7
commit 6054d53318
No known key found for this signature in database
GPG Key ID: 703F8C071DE7A1B6
5 changed files with 36 additions and 21 deletions

View File

@ -1,7 +1,8 @@
PROTO_DIR=./client/pb PROTO_DIR=client/pb
PROTO_IMPORT_PATH=./client PROTO_OUTPUT_PATH=client
PROTO_IMPORT_PATH=client
PROTO_FILES = \ PROTO_FILES := \
$(PROTO_DIR)/*.proto \ $(PROTO_DIR)/*.proto \
$(PROTO_DIR)/channel/*.proto \ $(PROTO_DIR)/channel/*.proto \
$(PROTO_DIR)/cmd0x3f6/*.proto \ $(PROTO_DIR)/cmd0x3f6/*.proto \
@ -26,6 +27,20 @@ PROTO_FILES = \
$(PROTO_DIR)/structmsg/*.proto \ $(PROTO_DIR)/structmsg/*.proto \
$(PROTO_DIR)/web/*.proto $(PROTO_DIR)/web/*.proto
proto: PROTOC_GEN_GOLITE_VERSION := \
protoc --golite_out=. --golite_opt=paths=source_relative -I=$(PROTO_IMPORT_PATH) $(PROTO_FILES) $(shell grep "github.com/RomiChan/protobuf" go.mod | awk -F v '{print "v"$$2}')
.PHONY: protoc-gen-golite-version clean install-protoc-plugin proto
.DEFAULT_GOAL := proto
protoc-gen-golite-version:
@echo "Use protoc-gen-golite version: $(PROTOC_GEN_GOLITE_VERSION)"
clean:
find . -name "*.pb.go" | xargs rm -f
install-protoc-plugin: protoc-gen-golite-version
go install github.com/RomiChan/protobuf/cmd/protoc-gen-golite@$(PROTOC_GEN_GOLITE_VERSION)
proto: install-protoc-plugin
protoc --golite_out=$(PROTO_IMPORT_PATH) --golite_opt=paths=source_relative -I=$(PROTO_IMPORT_PATH) $(PROTO_FILES)

View File

@ -16,7 +16,7 @@ const (
) )
type GetMessageRequest struct { type GetMessageRequest struct {
SyncFlag proto.Option[int32] `protobuf:"varint,1,opt"` SyncFlag proto.Option[SyncFlag] `protobuf:"varint,1,opt"`
SyncCookie []byte `protobuf:"bytes,2,opt"` SyncCookie []byte `protobuf:"bytes,2,opt"`
RambleFlag proto.Option[int32] `protobuf:"varint,3,opt"` RambleFlag proto.Option[int32] `protobuf:"varint,3,opt"`
LatestRambleNumber proto.Option[int32] `protobuf:"varint,4,opt"` LatestRambleNumber proto.Option[int32] `protobuf:"varint,4,opt"`

View File

@ -1,5 +1,5 @@
// Code generated by protoc-gen-golite. DO NOT EDIT. // Code generated by protoc-gen-golite. DO NOT EDIT.
// source: pb/oidb/oidb0xD79.proto // source: pb/oidb/oidb0xd79.proto
package oidb package oidb

2
go.mod
View File

@ -3,7 +3,7 @@ module github.com/Mrs4s/MiraiGo
go 1.18 go 1.18
require ( require (
github.com/RomiChan/protobuf v0.1.1-0.20220523101132-5546fc25db37 github.com/RomiChan/protobuf v0.1.1-0.20220524030518-4f349493f9da
github.com/RomiChan/syncx v0.0.0-20220404072119-d7ea0ae15a4c github.com/RomiChan/syncx v0.0.0-20220404072119-d7ea0ae15a4c
github.com/fumiama/imgsz v0.0.2 github.com/fumiama/imgsz v0.0.2
github.com/pierrec/lz4/v4 v4.1.11 github.com/pierrec/lz4/v4 v4.1.11

4
go.sum
View File

@ -1,5 +1,5 @@
github.com/RomiChan/protobuf v0.1.1-0.20220523101132-5546fc25db37 h1:MtLqymjslqAWUYMHqamYI9KKXq+am9JOyLIcSDWE3Ak= github.com/RomiChan/protobuf v0.1.1-0.20220524030518-4f349493f9da h1:T+Sc+QtOfpIRnfnOXaToyLvxmUmFwF2iaqxpJddI4Cc=
github.com/RomiChan/protobuf v0.1.1-0.20220523101132-5546fc25db37/go.mod h1:2Ie+hdBFQpQFDHfeklgxoFmQRCE7O+KwFpISeXq7OwA= github.com/RomiChan/protobuf v0.1.1-0.20220524030518-4f349493f9da/go.mod h1:2Ie+hdBFQpQFDHfeklgxoFmQRCE7O+KwFpISeXq7OwA=
github.com/RomiChan/syncx v0.0.0-20220404072119-d7ea0ae15a4c h1:cNPOdTNiVwxLpROLjXCgbIPvdkE+BwvxDvgmdYmWx6Q= github.com/RomiChan/syncx v0.0.0-20220404072119-d7ea0ae15a4c h1:cNPOdTNiVwxLpROLjXCgbIPvdkE+BwvxDvgmdYmWx6Q=
github.com/RomiChan/syncx v0.0.0-20220404072119-d7ea0ae15a4c/go.mod h1:KqZzu7slNKROh3TSYEH/IUMG6f4M+1qubZ5e52QypsE= github.com/RomiChan/syncx v0.0.0-20220404072119-d7ea0ae15a4c/go.mod h1:KqZzu7slNKROh3TSYEH/IUMG6f4M+1qubZ5e52QypsE=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=