release: v2
This commit is contained in:
parent
06ed1f232d
commit
13fd643c7a
13
Dockerfile
13
Dockerfile
@ -1,13 +1,12 @@
|
||||
FROM node:18-alpine3.18 as webui
|
||||
RUN npm config set registry https://registry.npmmirror.com
|
||||
COPY ./webui .
|
||||
RUN npm install && npm run build
|
||||
FROM images.internal/devel:latest
|
||||
|
||||
FROM images.local/golang:latest
|
||||
WORKDIR /app
|
||||
|
||||
COPY . /app
|
||||
COPY --from=0 dist /app/webui/dist
|
||||
RUN go mod tidy && go build .
|
||||
|
||||
RUN make build
|
||||
|
||||
EXPOSE 38002
|
||||
|
||||
EXPOSE 38080
|
||||
ENTRYPOINT [ "./pastebin", "api" ]
|
||||
|
27
Makefile
27
Makefile
@ -1,11 +1,26 @@
|
||||
all:
|
||||
cd webui && npm install && npm run build
|
||||
go mod tidy && go build .
|
||||
./pastebin api
|
||||
.PHONY : clean all ui api gen wire docker
|
||||
gen:
|
||||
ifeq ($(wildcard "webui/node_modules"),)
|
||||
buf generate
|
||||
else
|
||||
buf generate --exclude-path webui/node_modules
|
||||
endif
|
||||
|
||||
wire:
|
||||
go mod tidy
|
||||
cd gen/wire && wire
|
||||
|
||||
ui:
|
||||
cd webui && npm run build
|
||||
cd webui && npm install && npm run build
|
||||
|
||||
api:
|
||||
go build .
|
||||
go mod tidy && go build .
|
||||
|
||||
build: gen wire ui api
|
||||
|
||||
run: gen wire ui api
|
||||
./pastebin api
|
||||
|
||||
docker:
|
||||
podman build -t images.internal/pastebin:latest .
|
||||
podman push images.internal/pastebin:latest
|
||||
|
17
README.md
Normal file
17
README.md
Normal file
@ -0,0 +1,17 @@
|
||||
# pastebin
|
||||
|
||||
> 网络文本粘贴箱
|
||||
|
||||
## usage
|
||||
|
||||
```bash
|
||||
# 如果遇到proto变更 则进行如下操作
|
||||
make gen
|
||||
make wire
|
||||
|
||||
# 项目编译
|
||||
make all
|
||||
|
||||
# 项目本地运行
|
||||
make api
|
||||
```
|
19
buf.gen.yaml
19
buf.gen.yaml
@ -1,19 +1,22 @@
|
||||
version: v1
|
||||
managed:
|
||||
enabled: true
|
||||
go_package_prefix:
|
||||
default: pastebin/api_services
|
||||
plugins:
|
||||
- plugin: buf.build/protocolbuffers/go
|
||||
out: .
|
||||
out: gen
|
||||
opt: paths=source_relative
|
||||
- plugin: coco
|
||||
out: .
|
||||
# opt: paths=source_relative,disable_mongodb_model=true
|
||||
opt: paths=source_relative
|
||||
out: gen
|
||||
opt:
|
||||
- paths=source_relative
|
||||
- prefix=proto
|
||||
- project_name=pastebin
|
||||
- plugin: buf.build/community/stephenh-ts-proto
|
||||
out: ./webui/src/gen
|
||||
opt:
|
||||
- paths=source_relative
|
||||
- snakeToCamel=json
|
||||
- esModuleInterop=true
|
||||
- plugin: buf.build/grpc/go:v1.3.0
|
||||
out: gen
|
||||
opt:
|
||||
- paths=source_relative
|
||||
- require_unimplemented_servers=false
|
||||
|
3
buf.work.yaml
Normal file
3
buf.work.yaml
Normal file
@ -0,0 +1,3 @@
|
||||
version: v1
|
||||
directories:
|
||||
- proto
|
@ -2,10 +2,10 @@ version: "3"
|
||||
|
||||
services:
|
||||
server:
|
||||
image: images.local/pastebin:latest
|
||||
image: images.internal/pastebin:latest
|
||||
container_name: pastebin
|
||||
restart: always
|
||||
volumes:
|
||||
- /data/containers/pastebin:/app/data
|
||||
ports:
|
||||
- "30002:38080"
|
||||
- "38001:38080"
|
||||
|
@ -1,8 +1,8 @@
|
||||
// Code generated by protoc-gen-coco. DO NOT EDIT.
|
||||
// source: model/v1/pastebin_model.proto
|
||||
// generate at: 2023-10-15 21:21:24
|
||||
// source: v1/pastebin_model.proto
|
||||
// generate at: 2024-03-19 01:01:42
|
||||
|
||||
package modelv1
|
||||
package genv1
|
||||
|
||||
const TableNameModelPastebin = "pastebin"
|
||||
|
@ -1,8 +1,8 @@
|
||||
// Code generated by protoc-gen-coco. DO NOT EDIT.
|
||||
// source: api_services/v1/pastebin_module.proto
|
||||
// generate at: 2023-10-15 21:21:24
|
||||
// source: v1/pastebin_module.proto
|
||||
// generate at: 2024-03-19 01:01:42
|
||||
|
||||
package api_servicesv1
|
||||
package genv1
|
||||
|
||||
import (
|
||||
"gitter.top/coco/coco"
|
||||
@ -16,7 +16,9 @@ type AutoGenPastebinServiceImpl interface {
|
||||
Raw(ctx *coco.Context, req *PastebinServiceRawReq) (resp *PastebinServiceRawResp, err error)
|
||||
}
|
||||
|
||||
func (receiver *PastebinService) GetRouterMap() *coco.Routers {
|
||||
type PastebinService_RouterMap struct{}
|
||||
|
||||
func (receiver *PastebinService_RouterMap) GetRouterMap() *coco.Routers {
|
||||
return &coco.Routers{
|
||||
BaseURL: "/v1/pastebin",
|
||||
Apis: coco.RouterMap{
|
241
gen/v1/pastebin_model.pb.go
Normal file
241
gen/v1/pastebin_model.pb.go
Normal file
@ -0,0 +1,241 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.33.0
|
||||
// protoc (unknown)
|
||||
// source: v1/pastebin_model.proto
|
||||
|
||||
package genv1
|
||||
|
||||
import (
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
// @table_name: pastebin
|
||||
type ModelPastebin struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` // ID
|
||||
CreatedAt int64 `protobuf:"varint,2,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` // 创建时间
|
||||
ExpiredAt int64 `protobuf:"varint,3,opt,name=expired_at,json=expiredAt,proto3" json:"expired_at,omitempty"` // 过期时间
|
||||
ShortId string `protobuf:"bytes,4,opt,name=short_id,json=shortId,proto3" json:"short_id,omitempty"` // ID别名
|
||||
Title string `protobuf:"bytes,5,opt,name=title,proto3" json:"title,omitempty"` // 标题
|
||||
Author string `protobuf:"bytes,6,opt,name=author,proto3" json:"author,omitempty"` // 作者
|
||||
Content string `protobuf:"bytes,7,opt,name=content,proto3" json:"content,omitempty"` // 内容
|
||||
Lang string `protobuf:"bytes,8,opt,name=lang,proto3" json:"lang,omitempty"` // 语言
|
||||
Password string `protobuf:"bytes,9,opt,name=password,proto3" json:"password,omitempty"` // 是否需要密码
|
||||
NeedPassword bool `protobuf:"varint,10,opt,name=need_password,json=needPassword,proto3" json:"need_password,omitempty"` // 是否需要密码
|
||||
Editable bool `protobuf:"varint,11,opt,name=editable,proto3" json:"editable,omitempty"` // 是否可以修改
|
||||
}
|
||||
|
||||
func (x *ModelPastebin) Reset() {
|
||||
*x = ModelPastebin{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_v1_pastebin_model_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *ModelPastebin) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*ModelPastebin) ProtoMessage() {}
|
||||
|
||||
func (x *ModelPastebin) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_v1_pastebin_model_proto_msgTypes[0]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use ModelPastebin.ProtoReflect.Descriptor instead.
|
||||
func (*ModelPastebin) Descriptor() ([]byte, []int) {
|
||||
return file_v1_pastebin_model_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *ModelPastebin) GetId() int64 {
|
||||
if x != nil {
|
||||
return x.Id
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *ModelPastebin) GetCreatedAt() int64 {
|
||||
if x != nil {
|
||||
return x.CreatedAt
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *ModelPastebin) GetExpiredAt() int64 {
|
||||
if x != nil {
|
||||
return x.ExpiredAt
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *ModelPastebin) GetShortId() string {
|
||||
if x != nil {
|
||||
return x.ShortId
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *ModelPastebin) GetTitle() string {
|
||||
if x != nil {
|
||||
return x.Title
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *ModelPastebin) GetAuthor() string {
|
||||
if x != nil {
|
||||
return x.Author
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *ModelPastebin) GetContent() string {
|
||||
if x != nil {
|
||||
return x.Content
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *ModelPastebin) GetLang() string {
|
||||
if x != nil {
|
||||
return x.Lang
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *ModelPastebin) GetPassword() string {
|
||||
if x != nil {
|
||||
return x.Password
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *ModelPastebin) GetNeedPassword() bool {
|
||||
if x != nil {
|
||||
return x.NeedPassword
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func (x *ModelPastebin) GetEditable() bool {
|
||||
if x != nil {
|
||||
return x.Editable
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
var File_v1_pastebin_model_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_v1_pastebin_model_proto_rawDesc = []byte{
|
||||
0x0a, 0x17, 0x76, 0x31, 0x2f, 0x70, 0x61, 0x73, 0x74, 0x65, 0x62, 0x69, 0x6e, 0x5f, 0x6d, 0x6f,
|
||||
0x64, 0x65, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x08, 0x6d, 0x6f, 0x64, 0x65, 0x6c,
|
||||
0x2e, 0x76, 0x31, 0x22, 0xb1, 0x02, 0x0a, 0x0d, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x50, 0x61, 0x73,
|
||||
0x74, 0x65, 0x62, 0x69, 0x6e, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28,
|
||||
0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64,
|
||||
0x5f, 0x61, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74,
|
||||
0x65, 0x64, 0x41, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x64, 0x5f,
|
||||
0x61, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65,
|
||||
0x64, 0x41, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x73, 0x68, 0x6f, 0x72, 0x74, 0x5f, 0x69, 0x64, 0x18,
|
||||
0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x68, 0x6f, 0x72, 0x74, 0x49, 0x64, 0x12, 0x14,
|
||||
0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74,
|
||||
0x69, 0x74, 0x6c, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x18, 0x06,
|
||||
0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x12, 0x18, 0x0a, 0x07,
|
||||
0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63,
|
||||
0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6c, 0x61, 0x6e, 0x67, 0x18, 0x08,
|
||||
0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6c, 0x61, 0x6e, 0x67, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61,
|
||||
0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x61,
|
||||
0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x23, 0x0a, 0x0d, 0x6e, 0x65, 0x65, 0x64, 0x5f, 0x70,
|
||||
0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, 0x6e,
|
||||
0x65, 0x65, 0x64, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x65,
|
||||
0x64, 0x69, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x65,
|
||||
0x64, 0x69, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x42, 0x14, 0x5a, 0x12, 0x70, 0x61, 0x73, 0x74, 0x65,
|
||||
0x62, 0x69, 0x6e, 0x2f, 0x67, 0x65, 0x6e, 0x3b, 0x67, 0x65, 0x6e, 0x76, 0x31, 0x62, 0x06, 0x70,
|
||||
0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_v1_pastebin_model_proto_rawDescOnce sync.Once
|
||||
file_v1_pastebin_model_proto_rawDescData = file_v1_pastebin_model_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_v1_pastebin_model_proto_rawDescGZIP() []byte {
|
||||
file_v1_pastebin_model_proto_rawDescOnce.Do(func() {
|
||||
file_v1_pastebin_model_proto_rawDescData = protoimpl.X.CompressGZIP(file_v1_pastebin_model_proto_rawDescData)
|
||||
})
|
||||
return file_v1_pastebin_model_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_v1_pastebin_model_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
|
||||
var file_v1_pastebin_model_proto_goTypes = []interface{}{
|
||||
(*ModelPastebin)(nil), // 0: model.v1.ModelPastebin
|
||||
}
|
||||
var file_v1_pastebin_model_proto_depIdxs = []int32{
|
||||
0, // [0:0] is the sub-list for method output_type
|
||||
0, // [0:0] is the sub-list for method input_type
|
||||
0, // [0:0] is the sub-list for extension type_name
|
||||
0, // [0:0] is the sub-list for extension extendee
|
||||
0, // [0:0] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_v1_pastebin_model_proto_init() }
|
||||
func file_v1_pastebin_model_proto_init() {
|
||||
if File_v1_pastebin_model_proto != nil {
|
||||
return
|
||||
}
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_v1_pastebin_model_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*ModelPastebin); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_v1_pastebin_model_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 1,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
GoTypes: file_v1_pastebin_model_proto_goTypes,
|
||||
DependencyIndexes: file_v1_pastebin_model_proto_depIdxs,
|
||||
MessageInfos: file_v1_pastebin_model_proto_msgTypes,
|
||||
}.Build()
|
||||
File_v1_pastebin_model_proto = out.File
|
||||
file_v1_pastebin_model_proto_rawDesc = nil
|
||||
file_v1_pastebin_model_proto_goTypes = nil
|
||||
file_v1_pastebin_model_proto_depIdxs = nil
|
||||
}
|
@ -1,10 +1,10 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.31.0
|
||||
// protoc-gen-go v1.33.0
|
||||
// protoc (unknown)
|
||||
// source: api_services/v1/pastebin_module.proto
|
||||
// source: v1/pastebin_module.proto
|
||||
|
||||
package api_servicesv1
|
||||
package genv1
|
||||
|
||||
import (
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
@ -59,11 +59,11 @@ func (x ExpireLevel) String() string {
|
||||
}
|
||||
|
||||
func (ExpireLevel) Descriptor() protoreflect.EnumDescriptor {
|
||||
return file_api_services_v1_pastebin_module_proto_enumTypes[0].Descriptor()
|
||||
return file_v1_pastebin_module_proto_enumTypes[0].Descriptor()
|
||||
}
|
||||
|
||||
func (ExpireLevel) Type() protoreflect.EnumType {
|
||||
return &file_api_services_v1_pastebin_module_proto_enumTypes[0]
|
||||
return &file_v1_pastebin_module_proto_enumTypes[0]
|
||||
}
|
||||
|
||||
func (x ExpireLevel) Number() protoreflect.EnumNumber {
|
||||
@ -72,7 +72,7 @@ func (x ExpireLevel) Number() protoreflect.EnumNumber {
|
||||
|
||||
// Deprecated: Use ExpireLevel.Descriptor instead.
|
||||
func (ExpireLevel) EnumDescriptor() ([]byte, []int) {
|
||||
return file_api_services_v1_pastebin_module_proto_rawDescGZIP(), []int{0}
|
||||
return file_v1_pastebin_module_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
type PastebinServiceRecord struct {
|
||||
@ -97,7 +97,7 @@ type PastebinServiceRecord struct {
|
||||
func (x *PastebinServiceRecord) Reset() {
|
||||
*x = PastebinServiceRecord{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_api_services_v1_pastebin_module_proto_msgTypes[0]
|
||||
mi := &file_v1_pastebin_module_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
@ -110,7 +110,7 @@ func (x *PastebinServiceRecord) String() string {
|
||||
func (*PastebinServiceRecord) ProtoMessage() {}
|
||||
|
||||
func (x *PastebinServiceRecord) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_api_services_v1_pastebin_module_proto_msgTypes[0]
|
||||
mi := &file_v1_pastebin_module_proto_msgTypes[0]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
@ -123,7 +123,7 @@ func (x *PastebinServiceRecord) ProtoReflect() protoreflect.Message {
|
||||
|
||||
// Deprecated: Use PastebinServiceRecord.ProtoReflect.Descriptor instead.
|
||||
func (*PastebinServiceRecord) Descriptor() ([]byte, []int) {
|
||||
return file_api_services_v1_pastebin_module_proto_rawDescGZIP(), []int{0}
|
||||
return file_v1_pastebin_module_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *PastebinServiceRecord) GetId() int64 {
|
||||
@ -222,7 +222,7 @@ type PastebinServiceListReq struct {
|
||||
func (x *PastebinServiceListReq) Reset() {
|
||||
*x = PastebinServiceListReq{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_api_services_v1_pastebin_module_proto_msgTypes[1]
|
||||
mi := &file_v1_pastebin_module_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
@ -235,7 +235,7 @@ func (x *PastebinServiceListReq) String() string {
|
||||
func (*PastebinServiceListReq) ProtoMessage() {}
|
||||
|
||||
func (x *PastebinServiceListReq) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_api_services_v1_pastebin_module_proto_msgTypes[1]
|
||||
mi := &file_v1_pastebin_module_proto_msgTypes[1]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
@ -248,7 +248,7 @@ func (x *PastebinServiceListReq) ProtoReflect() protoreflect.Message {
|
||||
|
||||
// Deprecated: Use PastebinServiceListReq.ProtoReflect.Descriptor instead.
|
||||
func (*PastebinServiceListReq) Descriptor() ([]byte, []int) {
|
||||
return file_api_services_v1_pastebin_module_proto_rawDescGZIP(), []int{1}
|
||||
return file_v1_pastebin_module_proto_rawDescGZIP(), []int{1}
|
||||
}
|
||||
|
||||
func (x *PastebinServiceListReq) GetPageSize() int64 {
|
||||
@ -277,7 +277,7 @@ type PastebinServiceListResp struct {
|
||||
func (x *PastebinServiceListResp) Reset() {
|
||||
*x = PastebinServiceListResp{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_api_services_v1_pastebin_module_proto_msgTypes[2]
|
||||
mi := &file_v1_pastebin_module_proto_msgTypes[2]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
@ -290,7 +290,7 @@ func (x *PastebinServiceListResp) String() string {
|
||||
func (*PastebinServiceListResp) ProtoMessage() {}
|
||||
|
||||
func (x *PastebinServiceListResp) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_api_services_v1_pastebin_module_proto_msgTypes[2]
|
||||
mi := &file_v1_pastebin_module_proto_msgTypes[2]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
@ -303,7 +303,7 @@ func (x *PastebinServiceListResp) ProtoReflect() protoreflect.Message {
|
||||
|
||||
// Deprecated: Use PastebinServiceListResp.ProtoReflect.Descriptor instead.
|
||||
func (*PastebinServiceListResp) Descriptor() ([]byte, []int) {
|
||||
return file_api_services_v1_pastebin_module_proto_rawDescGZIP(), []int{2}
|
||||
return file_v1_pastebin_module_proto_rawDescGZIP(), []int{2}
|
||||
}
|
||||
|
||||
func (x *PastebinServiceListResp) GetItems() []*PastebinServiceRecord {
|
||||
@ -331,7 +331,7 @@ type PastebinServiceAddReq struct {
|
||||
func (x *PastebinServiceAddReq) Reset() {
|
||||
*x = PastebinServiceAddReq{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_api_services_v1_pastebin_module_proto_msgTypes[3]
|
||||
mi := &file_v1_pastebin_module_proto_msgTypes[3]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
@ -344,7 +344,7 @@ func (x *PastebinServiceAddReq) String() string {
|
||||
func (*PastebinServiceAddReq) ProtoMessage() {}
|
||||
|
||||
func (x *PastebinServiceAddReq) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_api_services_v1_pastebin_module_proto_msgTypes[3]
|
||||
mi := &file_v1_pastebin_module_proto_msgTypes[3]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
@ -357,7 +357,7 @@ func (x *PastebinServiceAddReq) ProtoReflect() protoreflect.Message {
|
||||
|
||||
// Deprecated: Use PastebinServiceAddReq.ProtoReflect.Descriptor instead.
|
||||
func (*PastebinServiceAddReq) Descriptor() ([]byte, []int) {
|
||||
return file_api_services_v1_pastebin_module_proto_rawDescGZIP(), []int{3}
|
||||
return file_v1_pastebin_module_proto_rawDescGZIP(), []int{3}
|
||||
}
|
||||
|
||||
func (x *PastebinServiceAddReq) GetRecord() *PastebinServiceRecord {
|
||||
@ -376,7 +376,7 @@ type PastebinServiceAddResp struct {
|
||||
func (x *PastebinServiceAddResp) Reset() {
|
||||
*x = PastebinServiceAddResp{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_api_services_v1_pastebin_module_proto_msgTypes[4]
|
||||
mi := &file_v1_pastebin_module_proto_msgTypes[4]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
@ -389,7 +389,7 @@ func (x *PastebinServiceAddResp) String() string {
|
||||
func (*PastebinServiceAddResp) ProtoMessage() {}
|
||||
|
||||
func (x *PastebinServiceAddResp) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_api_services_v1_pastebin_module_proto_msgTypes[4]
|
||||
mi := &file_v1_pastebin_module_proto_msgTypes[4]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
@ -402,7 +402,7 @@ func (x *PastebinServiceAddResp) ProtoReflect() protoreflect.Message {
|
||||
|
||||
// Deprecated: Use PastebinServiceAddResp.ProtoReflect.Descriptor instead.
|
||||
func (*PastebinServiceAddResp) Descriptor() ([]byte, []int) {
|
||||
return file_api_services_v1_pastebin_module_proto_rawDescGZIP(), []int{4}
|
||||
return file_v1_pastebin_module_proto_rawDescGZIP(), []int{4}
|
||||
}
|
||||
|
||||
type PastebinServiceUpdateReq struct {
|
||||
@ -416,7 +416,7 @@ type PastebinServiceUpdateReq struct {
|
||||
func (x *PastebinServiceUpdateReq) Reset() {
|
||||
*x = PastebinServiceUpdateReq{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_api_services_v1_pastebin_module_proto_msgTypes[5]
|
||||
mi := &file_v1_pastebin_module_proto_msgTypes[5]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
@ -429,7 +429,7 @@ func (x *PastebinServiceUpdateReq) String() string {
|
||||
func (*PastebinServiceUpdateReq) ProtoMessage() {}
|
||||
|
||||
func (x *PastebinServiceUpdateReq) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_api_services_v1_pastebin_module_proto_msgTypes[5]
|
||||
mi := &file_v1_pastebin_module_proto_msgTypes[5]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
@ -442,7 +442,7 @@ func (x *PastebinServiceUpdateReq) ProtoReflect() protoreflect.Message {
|
||||
|
||||
// Deprecated: Use PastebinServiceUpdateReq.ProtoReflect.Descriptor instead.
|
||||
func (*PastebinServiceUpdateReq) Descriptor() ([]byte, []int) {
|
||||
return file_api_services_v1_pastebin_module_proto_rawDescGZIP(), []int{5}
|
||||
return file_v1_pastebin_module_proto_rawDescGZIP(), []int{5}
|
||||
}
|
||||
|
||||
func (x *PastebinServiceUpdateReq) GetRecord() *PastebinServiceRecord {
|
||||
@ -461,7 +461,7 @@ type PastebinServiceUpdateResp struct {
|
||||
func (x *PastebinServiceUpdateResp) Reset() {
|
||||
*x = PastebinServiceUpdateResp{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_api_services_v1_pastebin_module_proto_msgTypes[6]
|
||||
mi := &file_v1_pastebin_module_proto_msgTypes[6]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
@ -474,7 +474,7 @@ func (x *PastebinServiceUpdateResp) String() string {
|
||||
func (*PastebinServiceUpdateResp) ProtoMessage() {}
|
||||
|
||||
func (x *PastebinServiceUpdateResp) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_api_services_v1_pastebin_module_proto_msgTypes[6]
|
||||
mi := &file_v1_pastebin_module_proto_msgTypes[6]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
@ -487,7 +487,7 @@ func (x *PastebinServiceUpdateResp) ProtoReflect() protoreflect.Message {
|
||||
|
||||
// Deprecated: Use PastebinServiceUpdateResp.ProtoReflect.Descriptor instead.
|
||||
func (*PastebinServiceUpdateResp) Descriptor() ([]byte, []int) {
|
||||
return file_api_services_v1_pastebin_module_proto_rawDescGZIP(), []int{6}
|
||||
return file_v1_pastebin_module_proto_rawDescGZIP(), []int{6}
|
||||
}
|
||||
|
||||
type PastebinServiceGetReq struct {
|
||||
@ -502,7 +502,7 @@ type PastebinServiceGetReq struct {
|
||||
func (x *PastebinServiceGetReq) Reset() {
|
||||
*x = PastebinServiceGetReq{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_api_services_v1_pastebin_module_proto_msgTypes[7]
|
||||
mi := &file_v1_pastebin_module_proto_msgTypes[7]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
@ -515,7 +515,7 @@ func (x *PastebinServiceGetReq) String() string {
|
||||
func (*PastebinServiceGetReq) ProtoMessage() {}
|
||||
|
||||
func (x *PastebinServiceGetReq) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_api_services_v1_pastebin_module_proto_msgTypes[7]
|
||||
mi := &file_v1_pastebin_module_proto_msgTypes[7]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
@ -528,7 +528,7 @@ func (x *PastebinServiceGetReq) ProtoReflect() protoreflect.Message {
|
||||
|
||||
// Deprecated: Use PastebinServiceGetReq.ProtoReflect.Descriptor instead.
|
||||
func (*PastebinServiceGetReq) Descriptor() ([]byte, []int) {
|
||||
return file_api_services_v1_pastebin_module_proto_rawDescGZIP(), []int{7}
|
||||
return file_v1_pastebin_module_proto_rawDescGZIP(), []int{7}
|
||||
}
|
||||
|
||||
func (x *PastebinServiceGetReq) GetKey() string {
|
||||
@ -556,7 +556,7 @@ type PastebinServiceGetResp struct {
|
||||
func (x *PastebinServiceGetResp) Reset() {
|
||||
*x = PastebinServiceGetResp{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_api_services_v1_pastebin_module_proto_msgTypes[8]
|
||||
mi := &file_v1_pastebin_module_proto_msgTypes[8]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
@ -569,7 +569,7 @@ func (x *PastebinServiceGetResp) String() string {
|
||||
func (*PastebinServiceGetResp) ProtoMessage() {}
|
||||
|
||||
func (x *PastebinServiceGetResp) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_api_services_v1_pastebin_module_proto_msgTypes[8]
|
||||
mi := &file_v1_pastebin_module_proto_msgTypes[8]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
@ -582,7 +582,7 @@ func (x *PastebinServiceGetResp) ProtoReflect() protoreflect.Message {
|
||||
|
||||
// Deprecated: Use PastebinServiceGetResp.ProtoReflect.Descriptor instead.
|
||||
func (*PastebinServiceGetResp) Descriptor() ([]byte, []int) {
|
||||
return file_api_services_v1_pastebin_module_proto_rawDescGZIP(), []int{8}
|
||||
return file_v1_pastebin_module_proto_rawDescGZIP(), []int{8}
|
||||
}
|
||||
|
||||
func (x *PastebinServiceGetResp) GetRecord() *PastebinServiceRecord {
|
||||
@ -604,7 +604,7 @@ type PastebinServiceRawReq struct {
|
||||
func (x *PastebinServiceRawReq) Reset() {
|
||||
*x = PastebinServiceRawReq{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_api_services_v1_pastebin_module_proto_msgTypes[9]
|
||||
mi := &file_v1_pastebin_module_proto_msgTypes[9]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
@ -617,7 +617,7 @@ func (x *PastebinServiceRawReq) String() string {
|
||||
func (*PastebinServiceRawReq) ProtoMessage() {}
|
||||
|
||||
func (x *PastebinServiceRawReq) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_api_services_v1_pastebin_module_proto_msgTypes[9]
|
||||
mi := &file_v1_pastebin_module_proto_msgTypes[9]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
@ -630,7 +630,7 @@ func (x *PastebinServiceRawReq) ProtoReflect() protoreflect.Message {
|
||||
|
||||
// Deprecated: Use PastebinServiceRawReq.ProtoReflect.Descriptor instead.
|
||||
func (*PastebinServiceRawReq) Descriptor() ([]byte, []int) {
|
||||
return file_api_services_v1_pastebin_module_proto_rawDescGZIP(), []int{9}
|
||||
return file_v1_pastebin_module_proto_rawDescGZIP(), []int{9}
|
||||
}
|
||||
|
||||
func (x *PastebinServiceRawReq) GetKey() string {
|
||||
@ -656,7 +656,7 @@ type PastebinServiceRawResp struct {
|
||||
func (x *PastebinServiceRawResp) Reset() {
|
||||
*x = PastebinServiceRawResp{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_api_services_v1_pastebin_module_proto_msgTypes[10]
|
||||
mi := &file_v1_pastebin_module_proto_msgTypes[10]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
@ -669,7 +669,7 @@ func (x *PastebinServiceRawResp) String() string {
|
||||
func (*PastebinServiceRawResp) ProtoMessage() {}
|
||||
|
||||
func (x *PastebinServiceRawResp) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_api_services_v1_pastebin_module_proto_msgTypes[10]
|
||||
mi := &file_v1_pastebin_module_proto_msgTypes[10]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
@ -682,146 +682,135 @@ func (x *PastebinServiceRawResp) ProtoReflect() protoreflect.Message {
|
||||
|
||||
// Deprecated: Use PastebinServiceRawResp.ProtoReflect.Descriptor instead.
|
||||
func (*PastebinServiceRawResp) Descriptor() ([]byte, []int) {
|
||||
return file_api_services_v1_pastebin_module_proto_rawDescGZIP(), []int{10}
|
||||
return file_v1_pastebin_module_proto_rawDescGZIP(), []int{10}
|
||||
}
|
||||
|
||||
var File_api_services_v1_pastebin_module_proto protoreflect.FileDescriptor
|
||||
var File_v1_pastebin_module_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_api_services_v1_pastebin_module_proto_rawDesc = []byte{
|
||||
0x0a, 0x25, 0x61, 0x70, 0x69, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2f, 0x76,
|
||||
0x31, 0x2f, 0x70, 0x61, 0x73, 0x74, 0x65, 0x62, 0x69, 0x6e, 0x5f, 0x6d, 0x6f, 0x64, 0x75, 0x6c,
|
||||
0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0f, 0x61, 0x70, 0x69, 0x5f, 0x73, 0x65, 0x72,
|
||||
0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x22, 0xf1, 0x02, 0x0a, 0x15, 0x50, 0x61, 0x73,
|
||||
0x74, 0x65, 0x62, 0x69, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x63, 0x6f,
|
||||
0x72, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02,
|
||||
0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52,
|
||||
0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x03, 0x20,
|
||||
0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f,
|
||||
0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e,
|
||||
0x74, 0x65, 0x6e, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f,
|
||||
0x61, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65,
|
||||
0x64, 0x41, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x64, 0x5f, 0x61,
|
||||
0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x64,
|
||||
0x41, 0x74, 0x12, 0x23, 0x0a, 0x0d, 0x6e, 0x65, 0x65, 0x64, 0x5f, 0x70, 0x61, 0x73, 0x73, 0x77,
|
||||
0x6f, 0x72, 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, 0x6e, 0x65, 0x65, 0x64, 0x50,
|
||||
0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x65, 0x64, 0x69, 0x74, 0x61,
|
||||
0x62, 0x6c, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x65, 0x64, 0x69, 0x74, 0x61,
|
||||
0x62, 0x6c, 0x65, 0x12, 0x3f, 0x0a, 0x0c, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x5f, 0x6c, 0x65,
|
||||
0x76, 0x65, 0x6c, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1c, 0x2e, 0x61, 0x70, 0x69, 0x5f,
|
||||
0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x70, 0x69,
|
||||
0x72, 0x65, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x52, 0x0b, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x4c,
|
||||
0x65, 0x76, 0x65, 0x6c, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64,
|
||||
0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64,
|
||||
0x12, 0x12, 0x0a, 0x04, 0x6c, 0x61, 0x6e, 0x67, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04,
|
||||
0x6c, 0x61, 0x6e, 0x67, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x18, 0x0d,
|
||||
0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x22, 0x58, 0x0a, 0x16,
|
||||
0x50, 0x61, 0x73, 0x74, 0x65, 0x62, 0x69, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4c,
|
||||
0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73,
|
||||
0x69, 0x7a, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53,
|
||||
0x69, 0x7a, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x70,
|
||||
0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x63, 0x75, 0x72, 0x72, 0x65,
|
||||
0x6e, 0x74, 0x50, 0x61, 0x67, 0x65, 0x22, 0x72, 0x0a, 0x17, 0x50, 0x61, 0x73, 0x74, 0x65, 0x62,
|
||||
0x69, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73,
|
||||
0x70, 0x12, 0x3c, 0x0a, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b,
|
||||
0x32, 0x26, 0x2e, 0x61, 0x70, 0x69, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e,
|
||||
0x76, 0x31, 0x2e, 0x50, 0x61, 0x73, 0x74, 0x65, 0x62, 0x69, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69,
|
||||
0x63, 0x65, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x12,
|
||||
0x19, 0x0a, 0x08, 0x68, 0x61, 0x73, 0x5f, 0x6d, 0x6f, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28,
|
||||
0x08, 0x52, 0x07, 0x68, 0x61, 0x73, 0x4d, 0x6f, 0x72, 0x65, 0x22, 0x57, 0x0a, 0x15, 0x50, 0x61,
|
||||
0x73, 0x74, 0x65, 0x62, 0x69, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x41, 0x64, 0x64,
|
||||
0x52, 0x65, 0x71, 0x12, 0x3e, 0x0a, 0x06, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x18, 0x01, 0x20,
|
||||
0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x61, 0x70, 0x69, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63,
|
||||
var file_v1_pastebin_module_proto_rawDesc = []byte{
|
||||
0x0a, 0x18, 0x76, 0x31, 0x2f, 0x70, 0x61, 0x73, 0x74, 0x65, 0x62, 0x69, 0x6e, 0x5f, 0x6d, 0x6f,
|
||||
0x64, 0x75, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0f, 0x61, 0x70, 0x69, 0x5f,
|
||||
0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x22, 0xf1, 0x02, 0x0a, 0x15,
|
||||
0x50, 0x61, 0x73, 0x74, 0x65, 0x62, 0x69, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52,
|
||||
0x65, 0x63, 0x6f, 0x72, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28,
|
||||
0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01,
|
||||
0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65,
|
||||
0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x18, 0x0a,
|
||||
0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07,
|
||||
0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74,
|
||||
0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x63, 0x72, 0x65,
|
||||
0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65,
|
||||
0x64, 0x5f, 0x61, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x65, 0x78, 0x70, 0x69,
|
||||
0x72, 0x65, 0x64, 0x41, 0x74, 0x12, 0x23, 0x0a, 0x0d, 0x6e, 0x65, 0x65, 0x64, 0x5f, 0x70, 0x61,
|
||||
0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, 0x6e, 0x65,
|
||||
0x65, 0x64, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x65, 0x64,
|
||||
0x69, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x65, 0x64,
|
||||
0x69, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x3f, 0x0a, 0x0c, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65,
|
||||
0x5f, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1c, 0x2e, 0x61,
|
||||
0x70, 0x69, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x45,
|
||||
0x78, 0x70, 0x69, 0x72, 0x65, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x52, 0x0b, 0x65, 0x78, 0x70, 0x69,
|
||||
0x72, 0x65, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77,
|
||||
0x6f, 0x72, 0x64, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77,
|
||||
0x6f, 0x72, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6c, 0x61, 0x6e, 0x67, 0x18, 0x0c, 0x20, 0x01, 0x28,
|
||||
0x09, 0x52, 0x04, 0x6c, 0x61, 0x6e, 0x67, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x75, 0x74, 0x68, 0x6f,
|
||||
0x72, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x22,
|
||||
0x58, 0x0a, 0x16, 0x50, 0x61, 0x73, 0x74, 0x65, 0x62, 0x69, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69,
|
||||
0x63, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x61, 0x67,
|
||||
0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x70, 0x61,
|
||||
0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e,
|
||||
0x74, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x63, 0x75,
|
||||
0x72, 0x72, 0x65, 0x6e, 0x74, 0x50, 0x61, 0x67, 0x65, 0x22, 0x72, 0x0a, 0x17, 0x50, 0x61, 0x73,
|
||||
0x74, 0x65, 0x62, 0x69, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4c, 0x69, 0x73, 0x74,
|
||||
0x52, 0x65, 0x73, 0x70, 0x12, 0x3c, 0x0a, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x01, 0x20,
|
||||
0x03, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x61, 0x70, 0x69, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63,
|
||||
0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x73, 0x74, 0x65, 0x62, 0x69, 0x6e, 0x53, 0x65,
|
||||
0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x06, 0x72, 0x65, 0x63,
|
||||
0x6f, 0x72, 0x64, 0x22, 0x18, 0x0a, 0x16, 0x50, 0x61, 0x73, 0x74, 0x65, 0x62, 0x69, 0x6e, 0x53,
|
||||
0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x41, 0x64, 0x64, 0x52, 0x65, 0x73, 0x70, 0x22, 0x5a, 0x0a,
|
||||
0x18, 0x50, 0x61, 0x73, 0x74, 0x65, 0x62, 0x69, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65,
|
||||
0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x12, 0x3e, 0x0a, 0x06, 0x72, 0x65, 0x63,
|
||||
0x6f, 0x72, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x61, 0x70, 0x69, 0x5f,
|
||||
0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x73, 0x74,
|
||||
0x65, 0x62, 0x69, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x63, 0x6f, 0x72,
|
||||
0x64, 0x52, 0x06, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x22, 0x1b, 0x0a, 0x19, 0x50, 0x61, 0x73,
|
||||
0x74, 0x65, 0x62, 0x69, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x55, 0x70, 0x64, 0x61,
|
||||
0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x22, 0x45, 0x0a, 0x15, 0x50, 0x61, 0x73, 0x74, 0x65, 0x62,
|
||||
0x69, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x47, 0x65, 0x74, 0x52, 0x65, 0x71, 0x12,
|
||||
0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65,
|
||||
0x79, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x02, 0x20,
|
||||
0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x22, 0x58, 0x0a,
|
||||
0x16, 0x50, 0x61, 0x73, 0x74, 0x65, 0x62, 0x69, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65,
|
||||
0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x3e, 0x0a, 0x06, 0x72, 0x65, 0x63, 0x6f, 0x72,
|
||||
0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x61, 0x70, 0x69, 0x5f, 0x73, 0x65,
|
||||
0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x73, 0x74, 0x65, 0x62,
|
||||
0x69, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52,
|
||||
0x06, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x22, 0x45, 0x0a, 0x15, 0x50, 0x61, 0x73, 0x74, 0x65,
|
||||
0x62, 0x69, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x61, 0x77, 0x52, 0x65, 0x71,
|
||||
0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b,
|
||||
0x65, 0x79, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x02,
|
||||
0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x22, 0x18,
|
||||
0x0a, 0x16, 0x50, 0x61, 0x73, 0x74, 0x65, 0x62, 0x69, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63,
|
||||
0x65, 0x52, 0x61, 0x77, 0x52, 0x65, 0x73, 0x70, 0x2a, 0x42, 0x0a, 0x0b, 0x45, 0x78, 0x70, 0x69,
|
||||
0x72, 0x65, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x0b, 0x0a, 0x07, 0x46, 0x6f, 0x72, 0x65, 0x76,
|
||||
0x65, 0x72, 0x10, 0x00, 0x12, 0x07, 0x0a, 0x03, 0x44, 0x61, 0x79, 0x10, 0x01, 0x12, 0x08, 0x0a,
|
||||
0x04, 0x57, 0x65, 0x65, 0x6b, 0x10, 0x02, 0x12, 0x09, 0x0a, 0x05, 0x4d, 0x6f, 0x6e, 0x74, 0x68,
|
||||
0x10, 0x03, 0x12, 0x08, 0x0a, 0x04, 0x59, 0x65, 0x61, 0x72, 0x10, 0x04, 0x32, 0xd5, 0x03, 0x0a,
|
||||
0x0f, 0x50, 0x61, 0x73, 0x74, 0x65, 0x62, 0x69, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65,
|
||||
0x12, 0x59, 0x0a, 0x04, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x27, 0x2e, 0x61, 0x70, 0x69, 0x5f, 0x73,
|
||||
0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x73, 0x74, 0x65,
|
||||
0x62, 0x69, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65,
|
||||
0x71, 0x1a, 0x28, 0x2e, 0x61, 0x70, 0x69, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73,
|
||||
0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x73, 0x74, 0x65, 0x62, 0x69, 0x6e, 0x53, 0x65, 0x72, 0x76,
|
||||
0x69, 0x63, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x56, 0x0a, 0x03, 0x41,
|
||||
0x64, 0x64, 0x12, 0x26, 0x2e, 0x61, 0x70, 0x69, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65,
|
||||
0x73, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x73, 0x74, 0x65, 0x62, 0x69, 0x6e, 0x53, 0x65, 0x72,
|
||||
0x76, 0x69, 0x63, 0x65, 0x41, 0x64, 0x64, 0x52, 0x65, 0x71, 0x1a, 0x27, 0x2e, 0x61, 0x70, 0x69,
|
||||
0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x73,
|
||||
0x74, 0x65, 0x62, 0x69, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x41, 0x64, 0x64, 0x52,
|
||||
0x65, 0x73, 0x70, 0x12, 0x5f, 0x0a, 0x06, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, 0x29, 0x2e,
|
||||
0x61, 0x70, 0x69, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e,
|
||||
0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x05, 0x69, 0x74, 0x65,
|
||||
0x6d, 0x73, 0x12, 0x19, 0x0a, 0x08, 0x68, 0x61, 0x73, 0x5f, 0x6d, 0x6f, 0x72, 0x65, 0x18, 0x02,
|
||||
0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x68, 0x61, 0x73, 0x4d, 0x6f, 0x72, 0x65, 0x22, 0x57, 0x0a,
|
||||
0x15, 0x50, 0x61, 0x73, 0x74, 0x65, 0x62, 0x69, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65,
|
||||
0x41, 0x64, 0x64, 0x52, 0x65, 0x71, 0x12, 0x3e, 0x0a, 0x06, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64,
|
||||
0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x61, 0x70, 0x69, 0x5f, 0x73, 0x65, 0x72,
|
||||
0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x73, 0x74, 0x65, 0x62, 0x69,
|
||||
0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x06,
|
||||
0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x22, 0x18, 0x0a, 0x16, 0x50, 0x61, 0x73, 0x74, 0x65, 0x62,
|
||||
0x69, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x41, 0x64, 0x64, 0x52, 0x65, 0x73, 0x70,
|
||||
0x22, 0x5a, 0x0a, 0x18, 0x50, 0x61, 0x73, 0x74, 0x65, 0x62, 0x69, 0x6e, 0x53, 0x65, 0x72, 0x76,
|
||||
0x69, 0x63, 0x65, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x12, 0x3e, 0x0a, 0x06,
|
||||
0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x61,
|
||||
0x70, 0x69, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x50,
|
||||
0x61, 0x73, 0x74, 0x65, 0x62, 0x69, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65,
|
||||
0x63, 0x6f, 0x72, 0x64, 0x52, 0x06, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x22, 0x1b, 0x0a, 0x19,
|
||||
0x50, 0x61, 0x73, 0x74, 0x65, 0x62, 0x69, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x55,
|
||||
0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x2a, 0x2e, 0x61, 0x70, 0x69, 0x5f, 0x73,
|
||||
0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x73, 0x74, 0x65,
|
||||
0x62, 0x69, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65,
|
||||
0x52, 0x65, 0x73, 0x70, 0x12, 0x56, 0x0a, 0x03, 0x47, 0x65, 0x74, 0x12, 0x26, 0x2e, 0x61, 0x70,
|
||||
0x69, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61,
|
||||
0x73, 0x74, 0x65, 0x62, 0x69, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x47, 0x65, 0x74,
|
||||
0x52, 0x65, 0x71, 0x1a, 0x27, 0x2e, 0x61, 0x70, 0x69, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63,
|
||||
0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x73, 0x74, 0x65, 0x62, 0x69, 0x6e, 0x53, 0x65,
|
||||
0x72, 0x76, 0x69, 0x63, 0x65, 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x56, 0x0a, 0x03,
|
||||
0x52, 0x61, 0x77, 0x12, 0x26, 0x2e, 0x61, 0x70, 0x69, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63,
|
||||
0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x73, 0x74, 0x65, 0x62, 0x69, 0x6e, 0x53, 0x65,
|
||||
0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x61, 0x77, 0x52, 0x65, 0x71, 0x1a, 0x27, 0x2e, 0x61, 0x70,
|
||||
0x69, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61,
|
||||
0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x22, 0x45, 0x0a, 0x15, 0x50, 0x61, 0x73,
|
||||
0x74, 0x65, 0x62, 0x69, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x47, 0x65, 0x74, 0x52,
|
||||
0x65, 0x71, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52,
|
||||
0x03, 0x6b, 0x65, 0x79, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64,
|
||||
0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64,
|
||||
0x22, 0x58, 0x0a, 0x16, 0x50, 0x61, 0x73, 0x74, 0x65, 0x62, 0x69, 0x6e, 0x53, 0x65, 0x72, 0x76,
|
||||
0x69, 0x63, 0x65, 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x3e, 0x0a, 0x06, 0x72, 0x65,
|
||||
0x63, 0x6f, 0x72, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x61, 0x70, 0x69,
|
||||
0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x73,
|
||||
0x74, 0x65, 0x62, 0x69, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x63, 0x6f,
|
||||
0x72, 0x64, 0x52, 0x06, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x22, 0x45, 0x0a, 0x15, 0x50, 0x61,
|
||||
0x73, 0x74, 0x65, 0x62, 0x69, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x61, 0x77,
|
||||
0x52, 0x65, 0x73, 0x70, 0x42, 0xb9, 0x01, 0x0a, 0x13, 0x63, 0x6f, 0x6d, 0x2e, 0x61, 0x70, 0x69,
|
||||
0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x42, 0x13, 0x50, 0x61,
|
||||
0x73, 0x74, 0x65, 0x62, 0x69, 0x6e, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x50, 0x72, 0x6f, 0x74,
|
||||
0x6f, 0x50, 0x01, 0x5a, 0x34, 0x70, 0x61, 0x73, 0x74, 0x65, 0x62, 0x69, 0x6e, 0x2f, 0x61, 0x70,
|
||||
0x69, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2f, 0x61, 0x70, 0x69, 0x5f, 0x73,
|
||||
0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2f, 0x76, 0x31, 0x3b, 0x61, 0x70, 0x69, 0x5f, 0x73,
|
||||
0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x41, 0x58, 0x58, 0xaa,
|
||||
0x02, 0x0e, 0x41, 0x70, 0x69, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x56, 0x31,
|
||||
0xca, 0x02, 0x0e, 0x41, 0x70, 0x69, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x5c, 0x56,
|
||||
0x31, 0xe2, 0x02, 0x1a, 0x41, 0x70, 0x69, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x5c,
|
||||
0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02,
|
||||
0x0f, 0x41, 0x70, 0x69, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x3a, 0x3a, 0x56, 0x31,
|
||||
0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
0x52, 0x65, 0x71, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09,
|
||||
0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72,
|
||||
0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72,
|
||||
0x64, 0x22, 0x18, 0x0a, 0x16, 0x50, 0x61, 0x73, 0x74, 0x65, 0x62, 0x69, 0x6e, 0x53, 0x65, 0x72,
|
||||
0x76, 0x69, 0x63, 0x65, 0x52, 0x61, 0x77, 0x52, 0x65, 0x73, 0x70, 0x2a, 0x42, 0x0a, 0x0b, 0x45,
|
||||
0x78, 0x70, 0x69, 0x72, 0x65, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x0b, 0x0a, 0x07, 0x46, 0x6f,
|
||||
0x72, 0x65, 0x76, 0x65, 0x72, 0x10, 0x00, 0x12, 0x07, 0x0a, 0x03, 0x44, 0x61, 0x79, 0x10, 0x01,
|
||||
0x12, 0x08, 0x0a, 0x04, 0x57, 0x65, 0x65, 0x6b, 0x10, 0x02, 0x12, 0x09, 0x0a, 0x05, 0x4d, 0x6f,
|
||||
0x6e, 0x74, 0x68, 0x10, 0x03, 0x12, 0x08, 0x0a, 0x04, 0x59, 0x65, 0x61, 0x72, 0x10, 0x04, 0x32,
|
||||
0xd5, 0x03, 0x0a, 0x0f, 0x50, 0x61, 0x73, 0x74, 0x65, 0x62, 0x69, 0x6e, 0x53, 0x65, 0x72, 0x76,
|
||||
0x69, 0x63, 0x65, 0x12, 0x59, 0x0a, 0x04, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x27, 0x2e, 0x61, 0x70,
|
||||
0x69, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61,
|
||||
0x73, 0x74, 0x65, 0x62, 0x69, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4c, 0x69, 0x73,
|
||||
0x74, 0x52, 0x65, 0x71, 0x1a, 0x28, 0x2e, 0x61, 0x70, 0x69, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69,
|
||||
0x63, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x73, 0x74, 0x65, 0x62, 0x69, 0x6e, 0x53,
|
||||
0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x56,
|
||||
0x0a, 0x03, 0x41, 0x64, 0x64, 0x12, 0x26, 0x2e, 0x61, 0x70, 0x69, 0x5f, 0x73, 0x65, 0x72, 0x76,
|
||||
0x69, 0x63, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x73, 0x74, 0x65, 0x62, 0x69, 0x6e,
|
||||
0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x41, 0x64, 0x64, 0x52, 0x65, 0x71, 0x1a, 0x27, 0x2e,
|
||||
0x61, 0x70, 0x69, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e,
|
||||
0x50, 0x61, 0x73, 0x74, 0x65, 0x62, 0x69, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x41,
|
||||
0x64, 0x64, 0x52, 0x65, 0x73, 0x70, 0x12, 0x5f, 0x0a, 0x06, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65,
|
||||
0x12, 0x29, 0x2e, 0x61, 0x70, 0x69, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e,
|
||||
0x76, 0x31, 0x2e, 0x50, 0x61, 0x73, 0x74, 0x65, 0x62, 0x69, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69,
|
||||
0x63, 0x65, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x2a, 0x2e, 0x61, 0x70,
|
||||
0x69, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61,
|
||||
0x73, 0x74, 0x65, 0x62, 0x69, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x55, 0x70, 0x64,
|
||||
0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x56, 0x0a, 0x03, 0x47, 0x65, 0x74, 0x12, 0x26,
|
||||
0x2e, 0x61, 0x70, 0x69, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x76, 0x31,
|
||||
0x2e, 0x50, 0x61, 0x73, 0x74, 0x65, 0x62, 0x69, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65,
|
||||
0x47, 0x65, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x27, 0x2e, 0x61, 0x70, 0x69, 0x5f, 0x73, 0x65, 0x72,
|
||||
0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x73, 0x74, 0x65, 0x62, 0x69,
|
||||
0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12,
|
||||
0x56, 0x0a, 0x03, 0x52, 0x61, 0x77, 0x12, 0x26, 0x2e, 0x61, 0x70, 0x69, 0x5f, 0x73, 0x65, 0x72,
|
||||
0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x73, 0x74, 0x65, 0x62, 0x69,
|
||||
0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x61, 0x77, 0x52, 0x65, 0x71, 0x1a, 0x27,
|
||||
0x2e, 0x61, 0x70, 0x69, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x76, 0x31,
|
||||
0x2e, 0x50, 0x61, 0x73, 0x74, 0x65, 0x62, 0x69, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65,
|
||||
0x52, 0x61, 0x77, 0x52, 0x65, 0x73, 0x70, 0x42, 0x14, 0x5a, 0x12, 0x70, 0x61, 0x73, 0x74, 0x65,
|
||||
0x62, 0x69, 0x6e, 0x2f, 0x67, 0x65, 0x6e, 0x3b, 0x67, 0x65, 0x6e, 0x76, 0x31, 0x62, 0x06, 0x70,
|
||||
0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_api_services_v1_pastebin_module_proto_rawDescOnce sync.Once
|
||||
file_api_services_v1_pastebin_module_proto_rawDescData = file_api_services_v1_pastebin_module_proto_rawDesc
|
||||
file_v1_pastebin_module_proto_rawDescOnce sync.Once
|
||||
file_v1_pastebin_module_proto_rawDescData = file_v1_pastebin_module_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_api_services_v1_pastebin_module_proto_rawDescGZIP() []byte {
|
||||
file_api_services_v1_pastebin_module_proto_rawDescOnce.Do(func() {
|
||||
file_api_services_v1_pastebin_module_proto_rawDescData = protoimpl.X.CompressGZIP(file_api_services_v1_pastebin_module_proto_rawDescData)
|
||||
func file_v1_pastebin_module_proto_rawDescGZIP() []byte {
|
||||
file_v1_pastebin_module_proto_rawDescOnce.Do(func() {
|
||||
file_v1_pastebin_module_proto_rawDescData = protoimpl.X.CompressGZIP(file_v1_pastebin_module_proto_rawDescData)
|
||||
})
|
||||
return file_api_services_v1_pastebin_module_proto_rawDescData
|
||||
return file_v1_pastebin_module_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_api_services_v1_pastebin_module_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
|
||||
var file_api_services_v1_pastebin_module_proto_msgTypes = make([]protoimpl.MessageInfo, 11)
|
||||
var file_api_services_v1_pastebin_module_proto_goTypes = []interface{}{
|
||||
var file_v1_pastebin_module_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
|
||||
var file_v1_pastebin_module_proto_msgTypes = make([]protoimpl.MessageInfo, 11)
|
||||
var file_v1_pastebin_module_proto_goTypes = []interface{}{
|
||||
(ExpireLevel)(0), // 0: api_services.v1.ExpireLevel
|
||||
(*PastebinServiceRecord)(nil), // 1: api_services.v1.PastebinServiceRecord
|
||||
(*PastebinServiceListReq)(nil), // 2: api_services.v1.PastebinServiceListReq
|
||||
@ -835,7 +824,7 @@ var file_api_services_v1_pastebin_module_proto_goTypes = []interface{}{
|
||||
(*PastebinServiceRawReq)(nil), // 10: api_services.v1.PastebinServiceRawReq
|
||||
(*PastebinServiceRawResp)(nil), // 11: api_services.v1.PastebinServiceRawResp
|
||||
}
|
||||
var file_api_services_v1_pastebin_module_proto_depIdxs = []int32{
|
||||
var file_v1_pastebin_module_proto_depIdxs = []int32{
|
||||
0, // 0: api_services.v1.PastebinServiceRecord.expire_level:type_name -> api_services.v1.ExpireLevel
|
||||
1, // 1: api_services.v1.PastebinServiceListResp.items:type_name -> api_services.v1.PastebinServiceRecord
|
||||
1, // 2: api_services.v1.PastebinServiceAddReq.record:type_name -> api_services.v1.PastebinServiceRecord
|
||||
@ -858,13 +847,13 @@ var file_api_services_v1_pastebin_module_proto_depIdxs = []int32{
|
||||
0, // [0:5] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_api_services_v1_pastebin_module_proto_init() }
|
||||
func file_api_services_v1_pastebin_module_proto_init() {
|
||||
if File_api_services_v1_pastebin_module_proto != nil {
|
||||
func init() { file_v1_pastebin_module_proto_init() }
|
||||
func file_v1_pastebin_module_proto_init() {
|
||||
if File_v1_pastebin_module_proto != nil {
|
||||
return
|
||||
}
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_api_services_v1_pastebin_module_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
file_v1_pastebin_module_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*PastebinServiceRecord); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
@ -876,7 +865,7 @@ func file_api_services_v1_pastebin_module_proto_init() {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_api_services_v1_pastebin_module_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
|
||||
file_v1_pastebin_module_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*PastebinServiceListReq); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
@ -888,7 +877,7 @@ func file_api_services_v1_pastebin_module_proto_init() {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_api_services_v1_pastebin_module_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
|
||||
file_v1_pastebin_module_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*PastebinServiceListResp); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
@ -900,7 +889,7 @@ func file_api_services_v1_pastebin_module_proto_init() {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_api_services_v1_pastebin_module_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
|
||||
file_v1_pastebin_module_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*PastebinServiceAddReq); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
@ -912,7 +901,7 @@ func file_api_services_v1_pastebin_module_proto_init() {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_api_services_v1_pastebin_module_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
|
||||
file_v1_pastebin_module_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*PastebinServiceAddResp); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
@ -924,7 +913,7 @@ func file_api_services_v1_pastebin_module_proto_init() {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_api_services_v1_pastebin_module_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
|
||||
file_v1_pastebin_module_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*PastebinServiceUpdateReq); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
@ -936,7 +925,7 @@ func file_api_services_v1_pastebin_module_proto_init() {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_api_services_v1_pastebin_module_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
|
||||
file_v1_pastebin_module_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*PastebinServiceUpdateResp); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
@ -948,7 +937,7 @@ func file_api_services_v1_pastebin_module_proto_init() {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_api_services_v1_pastebin_module_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {
|
||||
file_v1_pastebin_module_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*PastebinServiceGetReq); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
@ -960,7 +949,7 @@ func file_api_services_v1_pastebin_module_proto_init() {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_api_services_v1_pastebin_module_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} {
|
||||
file_v1_pastebin_module_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*PastebinServiceGetResp); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
@ -972,7 +961,7 @@ func file_api_services_v1_pastebin_module_proto_init() {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_api_services_v1_pastebin_module_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} {
|
||||
file_v1_pastebin_module_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*PastebinServiceRawReq); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
@ -984,7 +973,7 @@ func file_api_services_v1_pastebin_module_proto_init() {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_api_services_v1_pastebin_module_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} {
|
||||
file_v1_pastebin_module_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*PastebinServiceRawResp); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
@ -1001,19 +990,19 @@ func file_api_services_v1_pastebin_module_proto_init() {
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_api_services_v1_pastebin_module_proto_rawDesc,
|
||||
RawDescriptor: file_v1_pastebin_module_proto_rawDesc,
|
||||
NumEnums: 1,
|
||||
NumMessages: 11,
|
||||
NumExtensions: 0,
|
||||
NumServices: 1,
|
||||
},
|
||||
GoTypes: file_api_services_v1_pastebin_module_proto_goTypes,
|
||||
DependencyIndexes: file_api_services_v1_pastebin_module_proto_depIdxs,
|
||||
EnumInfos: file_api_services_v1_pastebin_module_proto_enumTypes,
|
||||
MessageInfos: file_api_services_v1_pastebin_module_proto_msgTypes,
|
||||
GoTypes: file_v1_pastebin_module_proto_goTypes,
|
||||
DependencyIndexes: file_v1_pastebin_module_proto_depIdxs,
|
||||
EnumInfos: file_v1_pastebin_module_proto_enumTypes,
|
||||
MessageInfos: file_v1_pastebin_module_proto_msgTypes,
|
||||
}.Build()
|
||||
File_api_services_v1_pastebin_module_proto = out.File
|
||||
file_api_services_v1_pastebin_module_proto_rawDesc = nil
|
||||
file_api_services_v1_pastebin_module_proto_goTypes = nil
|
||||
file_api_services_v1_pastebin_module_proto_depIdxs = nil
|
||||
File_v1_pastebin_module_proto = out.File
|
||||
file_v1_pastebin_module_proto_rawDesc = nil
|
||||
file_v1_pastebin_module_proto_goTypes = nil
|
||||
file_v1_pastebin_module_proto_depIdxs = nil
|
||||
}
|
295
gen/v1/pastebin_module_grpc.pb.go
Normal file
295
gen/v1/pastebin_module_grpc.pb.go
Normal file
@ -0,0 +1,295 @@
|
||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-grpc v1.3.0
|
||||
// - protoc (unknown)
|
||||
// source: v1/pastebin_module.proto
|
||||
|
||||
package genv1
|
||||
|
||||
import (
|
||||
context "context"
|
||||
grpc "google.golang.org/grpc"
|
||||
codes "google.golang.org/grpc/codes"
|
||||
status "google.golang.org/grpc/status"
|
||||
)
|
||||
|
||||
// This is a compile-time assertion to ensure that this generated file
|
||||
// is compatible with the grpc package it is being compiled against.
|
||||
// Requires gRPC-Go v1.32.0 or later.
|
||||
const _ = grpc.SupportPackageIsVersion7
|
||||
|
||||
const (
|
||||
PastebinService_List_FullMethodName = "/api_services.v1.PastebinService/List"
|
||||
PastebinService_Add_FullMethodName = "/api_services.v1.PastebinService/Add"
|
||||
PastebinService_Update_FullMethodName = "/api_services.v1.PastebinService/Update"
|
||||
PastebinService_Get_FullMethodName = "/api_services.v1.PastebinService/Get"
|
||||
PastebinService_Raw_FullMethodName = "/api_services.v1.PastebinService/Raw"
|
||||
)
|
||||
|
||||
// PastebinServiceClient is the client API for PastebinService service.
|
||||
//
|
||||
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
||||
type PastebinServiceClient interface {
|
||||
// @desc: 列表
|
||||
// @author: Young Xu
|
||||
// @method: GET
|
||||
// @api: /list
|
||||
List(ctx context.Context, in *PastebinServiceListReq, opts ...grpc.CallOption) (*PastebinServiceListResp, error)
|
||||
// @desc: 新建
|
||||
// @author: Young Xu
|
||||
// @method: PUT
|
||||
// @api: /add
|
||||
Add(ctx context.Context, in *PastebinServiceAddReq, opts ...grpc.CallOption) (*PastebinServiceAddResp, error)
|
||||
// @desc: 更新
|
||||
// @author: Young Xu
|
||||
// @method: POST
|
||||
// @api: /update
|
||||
Update(ctx context.Context, in *PastebinServiceUpdateReq, opts ...grpc.CallOption) (*PastebinServiceUpdateResp, error)
|
||||
// @desc: 获取一条记录
|
||||
// @author: Young Xu
|
||||
// @method: GET
|
||||
// @api: /get
|
||||
Get(ctx context.Context, in *PastebinServiceGetReq, opts ...grpc.CallOption) (*PastebinServiceGetResp, error)
|
||||
// @desc: 获取原文内容
|
||||
// @author: Young Xu
|
||||
// @method: GET
|
||||
// @api: /raw
|
||||
Raw(ctx context.Context, in *PastebinServiceRawReq, opts ...grpc.CallOption) (*PastebinServiceRawResp, error)
|
||||
}
|
||||
|
||||
type pastebinServiceClient struct {
|
||||
cc grpc.ClientConnInterface
|
||||
}
|
||||
|
||||
func NewPastebinServiceClient(cc grpc.ClientConnInterface) PastebinServiceClient {
|
||||
return &pastebinServiceClient{cc}
|
||||
}
|
||||
|
||||
func (c *pastebinServiceClient) List(ctx context.Context, in *PastebinServiceListReq, opts ...grpc.CallOption) (*PastebinServiceListResp, error) {
|
||||
out := new(PastebinServiceListResp)
|
||||
err := c.cc.Invoke(ctx, PastebinService_List_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *pastebinServiceClient) Add(ctx context.Context, in *PastebinServiceAddReq, opts ...grpc.CallOption) (*PastebinServiceAddResp, error) {
|
||||
out := new(PastebinServiceAddResp)
|
||||
err := c.cc.Invoke(ctx, PastebinService_Add_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *pastebinServiceClient) Update(ctx context.Context, in *PastebinServiceUpdateReq, opts ...grpc.CallOption) (*PastebinServiceUpdateResp, error) {
|
||||
out := new(PastebinServiceUpdateResp)
|
||||
err := c.cc.Invoke(ctx, PastebinService_Update_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *pastebinServiceClient) Get(ctx context.Context, in *PastebinServiceGetReq, opts ...grpc.CallOption) (*PastebinServiceGetResp, error) {
|
||||
out := new(PastebinServiceGetResp)
|
||||
err := c.cc.Invoke(ctx, PastebinService_Get_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *pastebinServiceClient) Raw(ctx context.Context, in *PastebinServiceRawReq, opts ...grpc.CallOption) (*PastebinServiceRawResp, error) {
|
||||
out := new(PastebinServiceRawResp)
|
||||
err := c.cc.Invoke(ctx, PastebinService_Raw_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// PastebinServiceServer is the server API for PastebinService service.
|
||||
// All implementations should embed UnimplementedPastebinServiceServer
|
||||
// for forward compatibility
|
||||
type PastebinServiceServer interface {
|
||||
// @desc: 列表
|
||||
// @author: Young Xu
|
||||
// @method: GET
|
||||
// @api: /list
|
||||
List(context.Context, *PastebinServiceListReq) (*PastebinServiceListResp, error)
|
||||
// @desc: 新建
|
||||
// @author: Young Xu
|
||||
// @method: PUT
|
||||
// @api: /add
|
||||
Add(context.Context, *PastebinServiceAddReq) (*PastebinServiceAddResp, error)
|
||||
// @desc: 更新
|
||||
// @author: Young Xu
|
||||
// @method: POST
|
||||
// @api: /update
|
||||
Update(context.Context, *PastebinServiceUpdateReq) (*PastebinServiceUpdateResp, error)
|
||||
// @desc: 获取一条记录
|
||||
// @author: Young Xu
|
||||
// @method: GET
|
||||
// @api: /get
|
||||
Get(context.Context, *PastebinServiceGetReq) (*PastebinServiceGetResp, error)
|
||||
// @desc: 获取原文内容
|
||||
// @author: Young Xu
|
||||
// @method: GET
|
||||
// @api: /raw
|
||||
Raw(context.Context, *PastebinServiceRawReq) (*PastebinServiceRawResp, error)
|
||||
}
|
||||
|
||||
// UnimplementedPastebinServiceServer should be embedded to have forward compatible implementations.
|
||||
type UnimplementedPastebinServiceServer struct {
|
||||
}
|
||||
|
||||
func (UnimplementedPastebinServiceServer) List(context.Context, *PastebinServiceListReq) (*PastebinServiceListResp, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method List not implemented")
|
||||
}
|
||||
func (UnimplementedPastebinServiceServer) Add(context.Context, *PastebinServiceAddReq) (*PastebinServiceAddResp, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method Add not implemented")
|
||||
}
|
||||
func (UnimplementedPastebinServiceServer) Update(context.Context, *PastebinServiceUpdateReq) (*PastebinServiceUpdateResp, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method Update not implemented")
|
||||
}
|
||||
func (UnimplementedPastebinServiceServer) Get(context.Context, *PastebinServiceGetReq) (*PastebinServiceGetResp, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method Get not implemented")
|
||||
}
|
||||
func (UnimplementedPastebinServiceServer) Raw(context.Context, *PastebinServiceRawReq) (*PastebinServiceRawResp, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method Raw not implemented")
|
||||
}
|
||||
|
||||
// UnsafePastebinServiceServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to PastebinServiceServer will
|
||||
// result in compilation errors.
|
||||
type UnsafePastebinServiceServer interface {
|
||||
mustEmbedUnimplementedPastebinServiceServer()
|
||||
}
|
||||
|
||||
func RegisterPastebinServiceServer(s grpc.ServiceRegistrar, srv PastebinServiceServer) {
|
||||
s.RegisterService(&PastebinService_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
func _PastebinService_List_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(PastebinServiceListReq)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(PastebinServiceServer).List(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: PastebinService_List_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(PastebinServiceServer).List(ctx, req.(*PastebinServiceListReq))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _PastebinService_Add_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(PastebinServiceAddReq)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(PastebinServiceServer).Add(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: PastebinService_Add_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(PastebinServiceServer).Add(ctx, req.(*PastebinServiceAddReq))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _PastebinService_Update_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(PastebinServiceUpdateReq)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(PastebinServiceServer).Update(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: PastebinService_Update_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(PastebinServiceServer).Update(ctx, req.(*PastebinServiceUpdateReq))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _PastebinService_Get_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(PastebinServiceGetReq)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(PastebinServiceServer).Get(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: PastebinService_Get_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(PastebinServiceServer).Get(ctx, req.(*PastebinServiceGetReq))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _PastebinService_Raw_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(PastebinServiceRawReq)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(PastebinServiceServer).Raw(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: PastebinService_Raw_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(PastebinServiceServer).Raw(ctx, req.(*PastebinServiceRawReq))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
// PastebinService_ServiceDesc is the grpc.ServiceDesc for PastebinService service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
var PastebinService_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "api_services.v1.PastebinService",
|
||||
HandlerType: (*PastebinServiceServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "List",
|
||||
Handler: _PastebinService_List_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "Add",
|
||||
Handler: _PastebinService_Add_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "Update",
|
||||
Handler: _PastebinService_Update_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "Get",
|
||||
Handler: _PastebinService_Get_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "Raw",
|
||||
Handler: _PastebinService_Raw_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "v1/pastebin_module.proto",
|
||||
}
|
25
gen/wire/wire.go
Normal file
25
gen/wire/wire.go
Normal file
@ -0,0 +1,25 @@
|
||||
//go:build wireinject
|
||||
// +build wireinject
|
||||
|
||||
package wire
|
||||
|
||||
import (
|
||||
"github.com/google/wire"
|
||||
|
||||
"pastebin/gen/v1"
|
||||
"pastebin/services/controller/v1"
|
||||
)
|
||||
|
||||
type PastebinService struct {
|
||||
*controllerv1.PastebinService
|
||||
*genv1.PastebinService_RouterMap
|
||||
}
|
||||
|
||||
func NewPastebinService(c *controllerv1.PastebinService, r *genv1.PastebinService_RouterMap) *PastebinService {
|
||||
return &PastebinService{c, r}
|
||||
}
|
||||
|
||||
func InitPastebinService() *PastebinService {
|
||||
wire.Build(wire.Struct(new(controllerv1.PastebinService)), wire.Struct(new(genv1.PastebinService_RouterMap)), NewPastebinService)
|
||||
return &PastebinService{}
|
||||
}
|
32
gen/wire/wire_gen.go
Normal file
32
gen/wire/wire_gen.go
Normal file
@ -0,0 +1,32 @@
|
||||
// Code generated by Wire. DO NOT EDIT.
|
||||
|
||||
//go:generate go run github.com/google/wire/cmd/wire
|
||||
//go:build !wireinject
|
||||
// +build !wireinject
|
||||
|
||||
package wire
|
||||
|
||||
import (
|
||||
"pastebin/gen/v1"
|
||||
"pastebin/services/controller/v1"
|
||||
)
|
||||
|
||||
// Injectors from wire.go:
|
||||
|
||||
func InitPastebinService() *PastebinService {
|
||||
pastebinService := &controllerv1.PastebinService{}
|
||||
pastebinService_RouterMap := &genv1.PastebinService_RouterMap{}
|
||||
wirePastebinService := NewPastebinService(pastebinService, pastebinService_RouterMap)
|
||||
return wirePastebinService
|
||||
}
|
||||
|
||||
// wire.go:
|
||||
|
||||
type PastebinService struct {
|
||||
*controllerv1.PastebinService
|
||||
*genv1.PastebinService_RouterMap
|
||||
}
|
||||
|
||||
func NewPastebinService(c *controllerv1.PastebinService, r *genv1.PastebinService_RouterMap) *PastebinService {
|
||||
return &PastebinService{c, r}
|
||||
}
|
53
go.mod
53
go.mod
@ -4,55 +4,60 @@ go 1.21.0
|
||||
|
||||
require (
|
||||
github.com/gin-gonic/gin v1.9.1
|
||||
github.com/google/wire v0.6.0
|
||||
github.com/sirupsen/logrus v1.9.3
|
||||
github.com/spf13/cobra v1.7.0
|
||||
github.com/spf13/cobra v1.8.0
|
||||
github.com/sqids/sqids-go v0.4.1
|
||||
gitter.top/coco/coco v0.0.1
|
||||
gitter.top/common/lormatter v0.0.0-20230910075849-28d49dccd03a
|
||||
gitter.top/common/lormatter v0.0.1
|
||||
gitter.top/drivers/sdbc v0.0.0-20230929063242-b4baa9aa7ff8
|
||||
google.golang.org/protobuf v1.31.0
|
||||
google.golang.org/grpc v1.62.1
|
||||
google.golang.org/protobuf v1.33.0
|
||||
gopkg.in/yaml.v3 v3.0.1
|
||||
)
|
||||
|
||||
require (
|
||||
github.com/bytedance/sonic v1.10.2 // indirect
|
||||
github.com/bytedance/sonic v1.11.3 // indirect
|
||||
github.com/chenzhuoyu/base64x v0.0.0-20230717121745-296ad89f973d // indirect
|
||||
github.com/chenzhuoyu/iasm v0.9.0 // indirect
|
||||
github.com/chenzhuoyu/iasm v0.9.1 // indirect
|
||||
github.com/dustin/go-humanize v1.0.1 // indirect
|
||||
github.com/gabriel-vasile/mimetype v1.4.3 // indirect
|
||||
github.com/gin-contrib/sse v0.1.0 // indirect
|
||||
github.com/glebarez/go-sqlite v1.21.2 // indirect
|
||||
github.com/glebarez/sqlite v1.9.0 // indirect
|
||||
github.com/glebarez/go-sqlite v1.22.0 // indirect
|
||||
github.com/glebarez/sqlite v1.11.0 // indirect
|
||||
github.com/go-playground/locales v0.14.1 // indirect
|
||||
github.com/go-playground/universal-translator v0.18.1 // indirect
|
||||
github.com/go-playground/validator/v10 v10.15.5 // indirect
|
||||
github.com/go-playground/validator/v10 v10.19.0 // indirect
|
||||
github.com/goccy/go-json v0.10.2 // indirect
|
||||
github.com/google/uuid v1.3.1 // indirect
|
||||
github.com/gorilla/schema v1.2.0 // indirect
|
||||
github.com/golang/protobuf v1.5.3 // indirect
|
||||
github.com/google/uuid v1.6.0 // indirect
|
||||
github.com/gorilla/schema v1.2.1 // indirect
|
||||
github.com/inconshreveable/mousetrap v1.1.0 // indirect
|
||||
github.com/jinzhu/inflection v1.0.0 // indirect
|
||||
github.com/jinzhu/now v1.1.5 // indirect
|
||||
github.com/json-iterator/go v1.1.12 // indirect
|
||||
github.com/klauspost/cpuid/v2 v2.2.5 // indirect
|
||||
github.com/leodido/go-urn v1.2.4 // indirect
|
||||
github.com/mattn/go-isatty v0.0.19 // indirect
|
||||
github.com/klauspost/cpuid/v2 v2.2.7 // indirect
|
||||
github.com/leodido/go-urn v1.4.0 // indirect
|
||||
github.com/mattn/go-isatty v0.0.20 // indirect
|
||||
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
|
||||
github.com/modern-go/reflect2 v1.0.2 // indirect
|
||||
github.com/pelletier/go-toml/v2 v2.1.0 // indirect
|
||||
github.com/ncruces/go-strftime v0.1.9 // indirect
|
||||
github.com/pelletier/go-toml/v2 v2.1.1 // indirect
|
||||
github.com/pkg/errors v0.9.1 // indirect
|
||||
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect
|
||||
github.com/spf13/pflag v1.0.5 // indirect
|
||||
github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
|
||||
github.com/ugorji/go/codec v1.2.11 // indirect
|
||||
gitter.top/common/goref v0.0.0-20230916075900-7b64840146ae // indirect
|
||||
golang.org/x/arch v0.5.0 // indirect
|
||||
golang.org/x/crypto v0.14.0 // indirect
|
||||
golang.org/x/net v0.17.0 // indirect
|
||||
golang.org/x/sys v0.13.0 // indirect
|
||||
golang.org/x/text v0.13.0 // indirect
|
||||
gorm.io/gorm v1.25.4 // indirect
|
||||
modernc.org/libc v1.24.1 // indirect
|
||||
github.com/ugorji/go/codec v1.2.12 // indirect
|
||||
gitter.top/common/goref v0.0.0-20240202181934-a82af1d66cc0 // indirect
|
||||
golang.org/x/arch v0.7.0 // indirect
|
||||
golang.org/x/crypto v0.21.0 // indirect
|
||||
golang.org/x/net v0.22.0 // indirect
|
||||
golang.org/x/sys v0.18.0 // indirect
|
||||
golang.org/x/text v0.14.0 // indirect
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20240123012728-ef4313101c80 // indirect
|
||||
gorm.io/gorm v1.25.8 // indirect
|
||||
modernc.org/libc v1.45.0 // indirect
|
||||
modernc.org/mathutil v1.6.0 // indirect
|
||||
modernc.org/memory v1.7.2 // indirect
|
||||
modernc.org/sqlite v1.25.0 // indirect
|
||||
modernc.org/sqlite v1.29.5 // indirect
|
||||
)
|
||||
|
@ -1,10 +1,12 @@
|
||||
package repositories
|
||||
|
||||
import (
|
||||
"gitter.top/drivers/sdbc"
|
||||
"pastebin/config"
|
||||
modelv1 "pastebin/model/v1"
|
||||
"time"
|
||||
|
||||
"gitter.top/drivers/sdbc"
|
||||
|
||||
"pastebin/config"
|
||||
genv1 "pastebin/gen/v1"
|
||||
)
|
||||
|
||||
var (
|
||||
@ -24,7 +26,7 @@ func GetPastebin() sdbc.Operator {
|
||||
})
|
||||
}
|
||||
if pastebinOperator == nil {
|
||||
pastebinOperator = driver.BindModel(&modelv1.ModelPastebin{})
|
||||
pastebinOperator = driver.BindModel(&genv1.ModelPastebin{})
|
||||
}
|
||||
return pastebinOperator
|
||||
}
|
||||
|
@ -1,249 +0,0 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.31.0
|
||||
// protoc (unknown)
|
||||
// source: model/v1/pastebin_model.proto
|
||||
|
||||
package modelv1
|
||||
|
||||
import (
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
// @table_name: pastebin
|
||||
type ModelPastebin struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` // ID
|
||||
CreatedAt int64 `protobuf:"varint,2,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` // 创建时间
|
||||
ExpiredAt int64 `protobuf:"varint,3,opt,name=expired_at,json=expiredAt,proto3" json:"expired_at,omitempty"` // 过期时间
|
||||
ShortId string `protobuf:"bytes,4,opt,name=short_id,json=shortId,proto3" json:"short_id,omitempty"` // ID别名
|
||||
Title string `protobuf:"bytes,5,opt,name=title,proto3" json:"title,omitempty"` // 标题
|
||||
Author string `protobuf:"bytes,6,opt,name=author,proto3" json:"author,omitempty"` // 作者
|
||||
Content string `protobuf:"bytes,7,opt,name=content,proto3" json:"content,omitempty"` // 内容
|
||||
Lang string `protobuf:"bytes,8,opt,name=lang,proto3" json:"lang,omitempty"` // 语言
|
||||
Password string `protobuf:"bytes,9,opt,name=password,proto3" json:"password,omitempty"` // 是否需要密码
|
||||
NeedPassword bool `protobuf:"varint,10,opt,name=need_password,json=needPassword,proto3" json:"need_password,omitempty"` // 是否需要密码
|
||||
Editable bool `protobuf:"varint,11,opt,name=editable,proto3" json:"editable,omitempty"` // 是否可以修改
|
||||
}
|
||||
|
||||
func (x *ModelPastebin) Reset() {
|
||||
*x = ModelPastebin{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_model_v1_pastebin_model_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *ModelPastebin) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*ModelPastebin) ProtoMessage() {}
|
||||
|
||||
func (x *ModelPastebin) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_model_v1_pastebin_model_proto_msgTypes[0]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use ModelPastebin.ProtoReflect.Descriptor instead.
|
||||
func (*ModelPastebin) Descriptor() ([]byte, []int) {
|
||||
return file_model_v1_pastebin_model_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *ModelPastebin) GetId() int64 {
|
||||
if x != nil {
|
||||
return x.Id
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *ModelPastebin) GetCreatedAt() int64 {
|
||||
if x != nil {
|
||||
return x.CreatedAt
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *ModelPastebin) GetExpiredAt() int64 {
|
||||
if x != nil {
|
||||
return x.ExpiredAt
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *ModelPastebin) GetShortId() string {
|
||||
if x != nil {
|
||||
return x.ShortId
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *ModelPastebin) GetTitle() string {
|
||||
if x != nil {
|
||||
return x.Title
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *ModelPastebin) GetAuthor() string {
|
||||
if x != nil {
|
||||
return x.Author
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *ModelPastebin) GetContent() string {
|
||||
if x != nil {
|
||||
return x.Content
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *ModelPastebin) GetLang() string {
|
||||
if x != nil {
|
||||
return x.Lang
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *ModelPastebin) GetPassword() string {
|
||||
if x != nil {
|
||||
return x.Password
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *ModelPastebin) GetNeedPassword() bool {
|
||||
if x != nil {
|
||||
return x.NeedPassword
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func (x *ModelPastebin) GetEditable() bool {
|
||||
if x != nil {
|
||||
return x.Editable
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
var File_model_v1_pastebin_model_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_model_v1_pastebin_model_proto_rawDesc = []byte{
|
||||
0x0a, 0x1d, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x61, 0x73, 0x74, 0x65,
|
||||
0x62, 0x69, 0x6e, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12,
|
||||
0x08, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2e, 0x76, 0x31, 0x22, 0xb1, 0x02, 0x0a, 0x0d, 0x4d, 0x6f,
|
||||
0x64, 0x65, 0x6c, 0x50, 0x61, 0x73, 0x74, 0x65, 0x62, 0x69, 0x6e, 0x12, 0x0e, 0x0a, 0x02, 0x69,
|
||||
0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x63,
|
||||
0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52,
|
||||
0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x65, 0x78,
|
||||
0x70, 0x69, 0x72, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09,
|
||||
0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x64, 0x41, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x73, 0x68, 0x6f,
|
||||
0x72, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x68, 0x6f,
|
||||
0x72, 0x74, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x05, 0x20,
|
||||
0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x75,
|
||||
0x74, 0x68, 0x6f, 0x72, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x61, 0x75, 0x74, 0x68,
|
||||
0x6f, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x07, 0x20,
|
||||
0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x12, 0x0a, 0x04,
|
||||
0x6c, 0x61, 0x6e, 0x67, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6c, 0x61, 0x6e, 0x67,
|
||||
0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x09, 0x20, 0x01,
|
||||
0x28, 0x09, 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x23, 0x0a, 0x0d,
|
||||
0x6e, 0x65, 0x65, 0x64, 0x5f, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x0a, 0x20,
|
||||
0x01, 0x28, 0x08, 0x52, 0x0c, 0x6e, 0x65, 0x65, 0x64, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72,
|
||||
0x64, 0x12, 0x1a, 0x0a, 0x08, 0x65, 0x64, 0x69, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x18, 0x0b, 0x20,
|
||||
0x01, 0x28, 0x08, 0x52, 0x08, 0x65, 0x64, 0x69, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x42, 0x8b, 0x01,
|
||||
0x0a, 0x0c, 0x63, 0x6f, 0x6d, 0x2e, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2e, 0x76, 0x31, 0x42, 0x12,
|
||||
0x50, 0x61, 0x73, 0x74, 0x65, 0x62, 0x69, 0x6e, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x50, 0x72, 0x6f,
|
||||
0x74, 0x6f, 0x50, 0x01, 0x5a, 0x26, 0x70, 0x61, 0x73, 0x74, 0x65, 0x62, 0x69, 0x6e, 0x2f, 0x61,
|
||||
0x70, 0x69, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2f, 0x6d, 0x6f, 0x64, 0x65,
|
||||
0x6c, 0x2f, 0x76, 0x31, 0x3b, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x4d,
|
||||
0x58, 0x58, 0xaa, 0x02, 0x08, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x08,
|
||||
0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x14, 0x4d, 0x6f, 0x64, 0x65, 0x6c,
|
||||
0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea,
|
||||
0x02, 0x09, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f,
|
||||
0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_model_v1_pastebin_model_proto_rawDescOnce sync.Once
|
||||
file_model_v1_pastebin_model_proto_rawDescData = file_model_v1_pastebin_model_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_model_v1_pastebin_model_proto_rawDescGZIP() []byte {
|
||||
file_model_v1_pastebin_model_proto_rawDescOnce.Do(func() {
|
||||
file_model_v1_pastebin_model_proto_rawDescData = protoimpl.X.CompressGZIP(file_model_v1_pastebin_model_proto_rawDescData)
|
||||
})
|
||||
return file_model_v1_pastebin_model_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_model_v1_pastebin_model_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
|
||||
var file_model_v1_pastebin_model_proto_goTypes = []interface{}{
|
||||
(*ModelPastebin)(nil), // 0: model.v1.ModelPastebin
|
||||
}
|
||||
var file_model_v1_pastebin_model_proto_depIdxs = []int32{
|
||||
0, // [0:0] is the sub-list for method output_type
|
||||
0, // [0:0] is the sub-list for method input_type
|
||||
0, // [0:0] is the sub-list for extension type_name
|
||||
0, // [0:0] is the sub-list for extension extendee
|
||||
0, // [0:0] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_model_v1_pastebin_model_proto_init() }
|
||||
func file_model_v1_pastebin_model_proto_init() {
|
||||
if File_model_v1_pastebin_model_proto != nil {
|
||||
return
|
||||
}
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_model_v1_pastebin_model_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*ModelPastebin); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_model_v1_pastebin_model_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 1,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
GoTypes: file_model_v1_pastebin_model_proto_goTypes,
|
||||
DependencyIndexes: file_model_v1_pastebin_model_proto_depIdxs,
|
||||
MessageInfos: file_model_v1_pastebin_model_proto_msgTypes,
|
||||
}.Build()
|
||||
File_model_v1_pastebin_model_proto = out.File
|
||||
file_model_v1_pastebin_model_proto_rawDesc = nil
|
||||
file_model_v1_pastebin_model_proto_goTypes = nil
|
||||
file_model_v1_pastebin_model_proto_depIdxs = nil
|
||||
}
|
9
proto/v1/buf.yaml
Normal file
9
proto/v1/buf.yaml
Normal file
@ -0,0 +1,9 @@
|
||||
version: v1
|
||||
breaking:
|
||||
use:
|
||||
- FILE
|
||||
lint:
|
||||
use:
|
||||
- DEFAULT
|
||||
except:
|
||||
- MINIMAL
|
@ -2,7 +2,7 @@ syntax = "proto3";
|
||||
|
||||
package model.v1;
|
||||
|
||||
option go_package = "./;modelv1";
|
||||
option go_package = "pastebin/gen;genv1";
|
||||
|
||||
|
||||
// @table_name: pastebin
|
@ -2,12 +2,12 @@ syntax = "proto3";
|
||||
|
||||
package api_services.v1;
|
||||
|
||||
option go_package = "./;api_servicesv1";
|
||||
option go_package = "pastebin/gen;genv1";
|
||||
|
||||
|
||||
// @route_group: true
|
||||
// @base_url: /v1/pastebin
|
||||
// @gen_to: ./api_services/v1/pastebin_controller.go
|
||||
// @gen_to: ./services/controller/v1/pastebin_controller.go
|
||||
service PastebinService {
|
||||
// @desc: 列表
|
||||
// @author: Young Xu
|
@ -4,9 +4,9 @@ import (
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/sirupsen/logrus"
|
||||
"gitter.top/coco/coco"
|
||||
"pastebin/api_services/v1"
|
||||
|
||||
"pastebin/config"
|
||||
"pastebin/gen/wire"
|
||||
)
|
||||
|
||||
type Router struct{}
|
||||
@ -21,8 +21,8 @@ func (receiver *Router) Register() error {
|
||||
// 从这里开始实例化路由注册器
|
||||
var register = coco.NewRegister()
|
||||
register.DefaultRouter(coco.WithListenAddress(cfg.ServerListen),
|
||||
coco.WithGinMode(gin.ReleaseMode), coco.WithCors(), coco.WithRecovery())
|
||||
register.RegisterStruct(&api_servicesv1.PastebinService{})
|
||||
coco.WithGinMode(gin.DebugMode), coco.WithCors(), coco.WithRecovery())
|
||||
register.RegisterStruct(wire.InitPastebinService())
|
||||
_ = register.PreRun(func() error {
|
||||
engine := register.RawEngine()
|
||||
engine.Static("/assets", "./webui/dist/assets")
|
||||
|
@ -1,22 +1,24 @@
|
||||
package api_servicesv1
|
||||
package controllerv1
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/sirupsen/logrus"
|
||||
"gitter.top/coco/coco"
|
||||
|
||||
"pastebin/common"
|
||||
genv1 "pastebin/gen/v1"
|
||||
"pastebin/internal/repositories"
|
||||
modelv1 "pastebin/model/v1"
|
||||
"time"
|
||||
)
|
||||
|
||||
type PastebinService struct{}
|
||||
|
||||
// IDE: PastebinService implemented PastebinServiceImpl interface
|
||||
var _ AutoGenPastebinServiceImpl = (*PastebinService)(nil)
|
||||
// IDE: PastebinService implemented genv1.AutoGenPastebinServiceImpl interface
|
||||
var _ genv1.AutoGenPastebinServiceImpl = (*PastebinService)(nil)
|
||||
|
||||
// List 列表
|
||||
func (receiver *PastebinService) List(ctx *coco.Context, req *PastebinServiceListReq) (resp *PastebinServiceListResp, err error) {
|
||||
resp = new(PastebinServiceListResp)
|
||||
func (receiver *PastebinService) List(ctx *coco.Context, req *genv1.PastebinServiceListReq) (resp *genv1.PastebinServiceListResp, err error) {
|
||||
resp = new(genv1.PastebinServiceListResp)
|
||||
|
||||
if req.PageSize == 0 {
|
||||
req.PageSize = 25
|
||||
@ -32,7 +34,7 @@ func (receiver *PastebinService) List(ctx *coco.Context, req *PastebinServiceLis
|
||||
|
||||
db := repositories.GetPastebin()
|
||||
|
||||
var records []modelv1.ModelPastebin
|
||||
var records []genv1.ModelPastebin
|
||||
|
||||
if err := db.Find().SetWhere("expired_at > ?", time.Now().Unix()).SetLimit(int(limit)).
|
||||
SetOffset(int(offset)).SetOrder("id desc").Find(&records); err != nil {
|
||||
@ -47,7 +49,7 @@ func (receiver *PastebinService) List(ctx *coco.Context, req *PastebinServiceLis
|
||||
}
|
||||
|
||||
for _, record := range records {
|
||||
item := &PastebinServiceRecord{
|
||||
item := &genv1.PastebinServiceRecord{
|
||||
Id: record.Id,
|
||||
Key: record.ShortId,
|
||||
Title: record.Title,
|
||||
@ -66,24 +68,24 @@ func (receiver *PastebinService) List(ctx *coco.Context, req *PastebinServiceLis
|
||||
}
|
||||
|
||||
// Add 新建
|
||||
func (receiver *PastebinService) Add(ctx *coco.Context, req *PastebinServiceAddReq) (resp *PastebinServiceAddResp, err error) {
|
||||
resp = new(PastebinServiceAddResp)
|
||||
func (receiver *PastebinService) Add(ctx *coco.Context, req *genv1.PastebinServiceAddReq) (resp *genv1.PastebinServiceAddResp, err error) {
|
||||
resp = new(genv1.PastebinServiceAddResp)
|
||||
|
||||
var expiredAt = time.Now()
|
||||
switch req.Record.ExpireLevel {
|
||||
case ExpireLevel_Forever:
|
||||
case genv1.ExpireLevel_Forever:
|
||||
expiredAt = expiredAt.Add(time.Hour * 87600)
|
||||
case ExpireLevel_Day:
|
||||
case genv1.ExpireLevel_Day:
|
||||
expiredAt = expiredAt.Add(time.Hour * 24)
|
||||
case ExpireLevel_Week:
|
||||
case genv1.ExpireLevel_Week:
|
||||
expiredAt = expiredAt.Add(time.Hour * 168)
|
||||
case ExpireLevel_Month:
|
||||
case genv1.ExpireLevel_Month:
|
||||
expiredAt = expiredAt.Add(time.Hour * 720)
|
||||
case ExpireLevel_Year:
|
||||
case genv1.ExpireLevel_Year:
|
||||
expiredAt = expiredAt.Add(time.Hour * 8760)
|
||||
}
|
||||
|
||||
var record = modelv1.ModelPastebin{
|
||||
var record = genv1.ModelPastebin{
|
||||
CreatedAt: time.Now().Unix(),
|
||||
ExpiredAt: expiredAt.Unix(),
|
||||
ShortId: common.UniqID(time.Now().UnixMilli()),
|
||||
@ -107,8 +109,8 @@ func (receiver *PastebinService) Add(ctx *coco.Context, req *PastebinServiceAddR
|
||||
}
|
||||
|
||||
// Update 更新
|
||||
func (receiver *PastebinService) Update(ctx *coco.Context, req *PastebinServiceUpdateReq) (resp *PastebinServiceUpdateResp, err error) {
|
||||
resp = new(PastebinServiceUpdateResp)
|
||||
func (receiver *PastebinService) Update(ctx *coco.Context, req *genv1.PastebinServiceUpdateReq) (resp *genv1.PastebinServiceUpdateResp, err error) {
|
||||
resp = new(genv1.PastebinServiceUpdateResp)
|
||||
|
||||
// TODO impl...
|
||||
|
||||
@ -116,12 +118,12 @@ func (receiver *PastebinService) Update(ctx *coco.Context, req *PastebinServiceU
|
||||
}
|
||||
|
||||
// Get 获取一条记录
|
||||
func (receiver *PastebinService) Get(ctx *coco.Context, req *PastebinServiceGetReq) (resp *PastebinServiceGetResp, err error) {
|
||||
resp = new(PastebinServiceGetResp)
|
||||
func (receiver *PastebinService) Get(ctx *coco.Context, req *genv1.PastebinServiceGetReq) (resp *genv1.PastebinServiceGetResp, err error) {
|
||||
resp = new(genv1.PastebinServiceGetResp)
|
||||
|
||||
db := repositories.GetPastebin()
|
||||
|
||||
var record modelv1.ModelPastebin
|
||||
var record genv1.ModelPastebin
|
||||
|
||||
if err := db.Find().SetWhere("short_id = ?", req.Key).FindOne(&record); err != nil {
|
||||
logrus.Errorf("query records failed: %v", err)
|
||||
@ -136,7 +138,7 @@ func (receiver *PastebinService) Get(ctx *coco.Context, req *PastebinServiceGetR
|
||||
return nil, coco.CreateErrorWithMsg(4002, "incorrect password")
|
||||
}
|
||||
|
||||
item := &PastebinServiceRecord{
|
||||
item := &genv1.PastebinServiceRecord{
|
||||
Id: record.Id,
|
||||
Key: record.ShortId,
|
||||
Title: record.Title,
|
||||
@ -154,12 +156,12 @@ func (receiver *PastebinService) Get(ctx *coco.Context, req *PastebinServiceGetR
|
||||
}
|
||||
|
||||
// Raw 获取原文内容
|
||||
func (receiver *PastebinService) Raw(ctx *coco.Context, req *PastebinServiceRawReq) (resp *PastebinServiceRawResp, err error) {
|
||||
resp = new(PastebinServiceRawResp)
|
||||
func (receiver *PastebinService) Raw(ctx *coco.Context, req *genv1.PastebinServiceRawReq) (resp *genv1.PastebinServiceRawResp, err error) {
|
||||
resp = new(genv1.PastebinServiceRawResp)
|
||||
|
||||
db := repositories.GetPastebin()
|
||||
|
||||
var record modelv1.ModelPastebin
|
||||
var record genv1.ModelPastebin
|
||||
|
||||
if err := db.Find().SetWhere("short_id = ?", req.Key).FindOne(&record); err != nil {
|
||||
logrus.Errorf("query records failed: %v", err)
|
280
webui/src/gen/v1/pastebin_model.ts
Normal file
280
webui/src/gen/v1/pastebin_model.ts
Normal file
@ -0,0 +1,280 @@
|
||||
/* eslint-disable */
|
||||
import Long from "long";
|
||||
import _m0 from "protobufjs/minimal";
|
||||
|
||||
export const protobufPackage = "model.v1";
|
||||
|
||||
/** @table_name: pastebin */
|
||||
export interface ModelPastebin {
|
||||
/** ID */
|
||||
id: number;
|
||||
/** 创建时间 */
|
||||
created_at: number;
|
||||
/** 过期时间 */
|
||||
expired_at: number;
|
||||
/** ID别名 */
|
||||
short_id: string;
|
||||
/** 标题 */
|
||||
title: string;
|
||||
/** 作者 */
|
||||
author: string;
|
||||
/** 内容 */
|
||||
content: string;
|
||||
/** 语言 */
|
||||
lang: string;
|
||||
/** 是否需要密码 */
|
||||
password: string;
|
||||
/** 是否需要密码 */
|
||||
need_password: boolean;
|
||||
/** 是否可以修改 */
|
||||
editable: boolean;
|
||||
}
|
||||
|
||||
function createBaseModelPastebin(): ModelPastebin {
|
||||
return {
|
||||
id: 0,
|
||||
created_at: 0,
|
||||
expired_at: 0,
|
||||
short_id: "",
|
||||
title: "",
|
||||
author: "",
|
||||
content: "",
|
||||
lang: "",
|
||||
password: "",
|
||||
need_password: false,
|
||||
editable: false,
|
||||
};
|
||||
}
|
||||
|
||||
export const ModelPastebin = {
|
||||
encode(message: ModelPastebin, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
||||
if (message.id !== 0) {
|
||||
writer.uint32(8).int64(message.id);
|
||||
}
|
||||
if (message.created_at !== 0) {
|
||||
writer.uint32(16).int64(message.created_at);
|
||||
}
|
||||
if (message.expired_at !== 0) {
|
||||
writer.uint32(24).int64(message.expired_at);
|
||||
}
|
||||
if (message.short_id !== "") {
|
||||
writer.uint32(34).string(message.short_id);
|
||||
}
|
||||
if (message.title !== "") {
|
||||
writer.uint32(42).string(message.title);
|
||||
}
|
||||
if (message.author !== "") {
|
||||
writer.uint32(50).string(message.author);
|
||||
}
|
||||
if (message.content !== "") {
|
||||
writer.uint32(58).string(message.content);
|
||||
}
|
||||
if (message.lang !== "") {
|
||||
writer.uint32(66).string(message.lang);
|
||||
}
|
||||
if (message.password !== "") {
|
||||
writer.uint32(74).string(message.password);
|
||||
}
|
||||
if (message.need_password === true) {
|
||||
writer.uint32(80).bool(message.need_password);
|
||||
}
|
||||
if (message.editable === true) {
|
||||
writer.uint32(88).bool(message.editable);
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number): ModelPastebin {
|
||||
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
||||
let end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseModelPastebin();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1:
|
||||
if (tag !== 8) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.id = longToNumber(reader.int64() as Long);
|
||||
continue;
|
||||
case 2:
|
||||
if (tag !== 16) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.created_at = longToNumber(reader.int64() as Long);
|
||||
continue;
|
||||
case 3:
|
||||
if (tag !== 24) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.expired_at = longToNumber(reader.int64() as Long);
|
||||
continue;
|
||||
case 4:
|
||||
if (tag !== 34) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.short_id = reader.string();
|
||||
continue;
|
||||
case 5:
|
||||
if (tag !== 42) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.title = reader.string();
|
||||
continue;
|
||||
case 6:
|
||||
if (tag !== 50) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.author = reader.string();
|
||||
continue;
|
||||
case 7:
|
||||
if (tag !== 58) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.content = reader.string();
|
||||
continue;
|
||||
case 8:
|
||||
if (tag !== 66) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.lang = reader.string();
|
||||
continue;
|
||||
case 9:
|
||||
if (tag !== 74) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.password = reader.string();
|
||||
continue;
|
||||
case 10:
|
||||
if (tag !== 80) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.need_password = reader.bool();
|
||||
continue;
|
||||
case 11:
|
||||
if (tag !== 88) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.editable = reader.bool();
|
||||
continue;
|
||||
}
|
||||
if ((tag & 7) === 4 || tag === 0) {
|
||||
break;
|
||||
}
|
||||
reader.skipType(tag & 7);
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): ModelPastebin {
|
||||
return {
|
||||
id: isSet(object.id) ? globalThis.Number(object.id) : 0,
|
||||
created_at: isSet(object.createdAt) ? globalThis.Number(object.createdAt) : 0,
|
||||
expired_at: isSet(object.expiredAt) ? globalThis.Number(object.expiredAt) : 0,
|
||||
short_id: isSet(object.shortId) ? globalThis.String(object.shortId) : "",
|
||||
title: isSet(object.title) ? globalThis.String(object.title) : "",
|
||||
author: isSet(object.author) ? globalThis.String(object.author) : "",
|
||||
content: isSet(object.content) ? globalThis.String(object.content) : "",
|
||||
lang: isSet(object.lang) ? globalThis.String(object.lang) : "",
|
||||
password: isSet(object.password) ? globalThis.String(object.password) : "",
|
||||
need_password: isSet(object.needPassword) ? globalThis.Boolean(object.needPassword) : false,
|
||||
editable: isSet(object.editable) ? globalThis.Boolean(object.editable) : false,
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: ModelPastebin): unknown {
|
||||
const obj: any = {};
|
||||
if (message.id !== 0) {
|
||||
obj.id = Math.round(message.id);
|
||||
}
|
||||
if (message.created_at !== 0) {
|
||||
obj.createdAt = Math.round(message.created_at);
|
||||
}
|
||||
if (message.expired_at !== 0) {
|
||||
obj.expiredAt = Math.round(message.expired_at);
|
||||
}
|
||||
if (message.short_id !== "") {
|
||||
obj.shortId = message.short_id;
|
||||
}
|
||||
if (message.title !== "") {
|
||||
obj.title = message.title;
|
||||
}
|
||||
if (message.author !== "") {
|
||||
obj.author = message.author;
|
||||
}
|
||||
if (message.content !== "") {
|
||||
obj.content = message.content;
|
||||
}
|
||||
if (message.lang !== "") {
|
||||
obj.lang = message.lang;
|
||||
}
|
||||
if (message.password !== "") {
|
||||
obj.password = message.password;
|
||||
}
|
||||
if (message.need_password === true) {
|
||||
obj.needPassword = message.need_password;
|
||||
}
|
||||
if (message.editable === true) {
|
||||
obj.editable = message.editable;
|
||||
}
|
||||
return obj;
|
||||
},
|
||||
|
||||
create<I extends Exact<DeepPartial<ModelPastebin>, I>>(base?: I): ModelPastebin {
|
||||
return ModelPastebin.fromPartial(base ?? ({} as any));
|
||||
},
|
||||
fromPartial<I extends Exact<DeepPartial<ModelPastebin>, I>>(object: I): ModelPastebin {
|
||||
const message = createBaseModelPastebin();
|
||||
message.id = object.id ?? 0;
|
||||
message.created_at = object.created_at ?? 0;
|
||||
message.expired_at = object.expired_at ?? 0;
|
||||
message.short_id = object.short_id ?? "";
|
||||
message.title = object.title ?? "";
|
||||
message.author = object.author ?? "";
|
||||
message.content = object.content ?? "";
|
||||
message.lang = object.lang ?? "";
|
||||
message.password = object.password ?? "";
|
||||
message.need_password = object.need_password ?? false;
|
||||
message.editable = object.editable ?? false;
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
||||
|
||||
export type DeepPartial<T> = T extends Builtin ? T
|
||||
: T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
|
||||
: T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
|
||||
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
|
||||
: Partial<T>;
|
||||
|
||||
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
||||
export type Exact<P, I extends P> = P extends Builtin ? P
|
||||
: P & { [K in keyof P]: Exact<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion<P>>]: never };
|
||||
|
||||
function longToNumber(long: Long): number {
|
||||
if (long.gt(globalThis.Number.MAX_SAFE_INTEGER)) {
|
||||
throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");
|
||||
}
|
||||
return long.toNumber();
|
||||
}
|
||||
|
||||
if (_m0.util.Long !== Long) {
|
||||
_m0.util.Long = Long as any;
|
||||
_m0.configure();
|
||||
}
|
||||
|
||||
function isSet(value: any): boolean {
|
||||
return value !== null && value !== undefined;
|
||||
}
|
1088
webui/src/gen/v1/pastebin_module.ts
Normal file
1088
webui/src/gen/v1/pastebin_module.ts
Normal file
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user