From 7c4ccbef3ff4d69fb7609a6e892de24767880678 Mon Sep 17 00:00:00 2001 From: steven Date: Sat, 2 Sep 2023 14:17:23 +0800 Subject: [PATCH] chore: add auto backup workspace setting --- .../proto/store/workspace_setting_pb.d.ts | 100 ++++++ .../types/proto/store/workspace_setting_pb.js | 41 +++ proto/gen/store/README.md | 67 ++++ proto/gen/store/workspace_setting.pb.go | 337 ++++++++++++++++++ proto/store/workspace_setting.proto | 30 ++ 5 files changed, 575 insertions(+) create mode 100644 frontend/types/proto/store/workspace_setting_pb.d.ts create mode 100644 frontend/types/proto/store/workspace_setting_pb.js create mode 100644 proto/gen/store/workspace_setting.pb.go create mode 100644 proto/store/workspace_setting.proto diff --git a/frontend/types/proto/store/workspace_setting_pb.d.ts b/frontend/types/proto/store/workspace_setting_pb.d.ts new file mode 100644 index 0000000..3346c51 --- /dev/null +++ b/frontend/types/proto/store/workspace_setting_pb.d.ts @@ -0,0 +1,100 @@ +// @generated by protoc-gen-es v1.3.0 +// @generated from file store/workspace_setting.proto (package slash.store, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; +import { Message, proto3 } from "@bufbuild/protobuf"; + +/** + * @generated from enum slash.store.WorkspaceSettingKey + */ +export declare enum WorkspaceSettingKey { + /** + * @generated from enum value: WORKSPACE_SETTING_KEY_UNSPECIFIED = 0; + */ + WORKSPACE_SETTING_KEY_UNSPECIFIED = 0, + + /** + * @generated from enum value: WORKSPACE_SETTING_AUTO_BACKUP = 1; + */ + WORKSPACE_SETTING_AUTO_BACKUP = 1, +} + +/** + * @generated from message slash.store.WorkspaceSetting + */ +export declare class WorkspaceSetting extends Message { + /** + * @generated from field: slash.store.WorkspaceSettingKey key = 1; + */ + key: WorkspaceSettingKey; + + /** + * @generated from oneof slash.store.WorkspaceSetting.value + */ + value: { + /** + * @generated from field: slash.store.AutoBackupWorkspaceSetting auto_backup = 2; + */ + value: AutoBackupWorkspaceSetting; + case: "autoBackup"; + } | { case: undefined; value?: undefined }; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "slash.store.WorkspaceSetting"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): WorkspaceSetting; + + static fromJson(jsonValue: JsonValue, options?: Partial): WorkspaceSetting; + + static fromJsonString(jsonString: string, options?: Partial): WorkspaceSetting; + + static equals(a: WorkspaceSetting | PlainMessage | undefined, b: WorkspaceSetting | PlainMessage | undefined): boolean; +} + +/** + * @generated from message slash.store.AutoBackupWorkspaceSetting + */ +export declare class AutoBackupWorkspaceSetting extends Message { + /** + * Whether auto backup is enabled. + * + * @generated from field: bool enabled = 1; + */ + enabled: boolean; + + /** + * The cron expression for auto backup. + * For example, "0 0 0 * * *" means backup at 00:00:00 every day. + * See https://en.wikipedia.org/wiki/Cron for more details. + * + * @generated from field: string cron_expression = 2; + */ + cronExpression: string; + + /** + * The maximum number of backups to keep. + * + * @generated from field: int32 max_keep = 3; + */ + maxKeep: number; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "slash.store.AutoBackupWorkspaceSetting"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): AutoBackupWorkspaceSetting; + + static fromJson(jsonValue: JsonValue, options?: Partial): AutoBackupWorkspaceSetting; + + static fromJsonString(jsonString: string, options?: Partial): AutoBackupWorkspaceSetting; + + static equals(a: AutoBackupWorkspaceSetting | PlainMessage | undefined, b: AutoBackupWorkspaceSetting | PlainMessage | undefined): boolean; +} + diff --git a/frontend/types/proto/store/workspace_setting_pb.js b/frontend/types/proto/store/workspace_setting_pb.js new file mode 100644 index 0000000..26a9262 --- /dev/null +++ b/frontend/types/proto/store/workspace_setting_pb.js @@ -0,0 +1,41 @@ +// @generated by protoc-gen-es v1.3.0 +// @generated from file store/workspace_setting.proto (package slash.store, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import { proto3 } from "@bufbuild/protobuf"; + +/** + * @generated from enum slash.store.WorkspaceSettingKey + */ +export const WorkspaceSettingKey = proto3.makeEnum( + "slash.store.WorkspaceSettingKey", + [ + {no: 0, name: "WORKSPACE_SETTING_KEY_UNSPECIFIED"}, + {no: 1, name: "WORKSPACE_SETTING_AUTO_BACKUP"}, + ], +); + +/** + * @generated from message slash.store.WorkspaceSetting + */ +export const WorkspaceSetting = proto3.makeMessageType( + "slash.store.WorkspaceSetting", + () => [ + { no: 1, name: "key", kind: "enum", T: proto3.getEnumType(WorkspaceSettingKey) }, + { no: 2, name: "auto_backup", kind: "message", T: AutoBackupWorkspaceSetting, oneof: "value" }, + ], +); + +/** + * @generated from message slash.store.AutoBackupWorkspaceSetting + */ +export const AutoBackupWorkspaceSetting = proto3.makeMessageType( + "slash.store.AutoBackupWorkspaceSetting", + () => [ + { no: 1, name: "enabled", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, + { no: 2, name: "cron_expression", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 3, name: "max_keep", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, + ], +); + diff --git a/proto/gen/store/README.md b/proto/gen/store/README.md index 5abf528..cd68551 100644 --- a/proto/gen/store/README.md +++ b/proto/gen/store/README.md @@ -23,6 +23,12 @@ - [LocaleUserSetting](#slash-store-LocaleUserSetting) - [UserSettingKey](#slash-store-UserSettingKey) +- [store/workspace_setting.proto](#store_workspace_setting-proto) + - [AutoBackupWorkspaceSetting](#slash-store-AutoBackupWorkspaceSetting) + - [WorkspaceSetting](#slash-store-WorkspaceSetting) + + - [WorkspaceSettingKey](#slash-store-WorkspaceSettingKey) + - [Scalar Value Types](#scalar-value-types) @@ -251,6 +257,67 @@ + +

Top

+ +## store/workspace_setting.proto + + + + + +### AutoBackupWorkspaceSetting + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| enabled | [bool](#bool) | | Whether auto backup is enabled. | +| cron_expression | [string](#string) | | The cron expression for auto backup. For example, "0 0 0 * * *" means backup at 00:00:00 every day. See https://en.wikipedia.org/wiki/Cron for more details. | +| max_keep | [int32](#int32) | | The maximum number of backups to keep. | + + + + + + + + +### WorkspaceSetting + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| key | [WorkspaceSettingKey](#slash-store-WorkspaceSettingKey) | | | +| auto_backup | [AutoBackupWorkspaceSetting](#slash-store-AutoBackupWorkspaceSetting) | | | + + + + + + + + + + +### WorkspaceSettingKey + + +| Name | Number | Description | +| ---- | ------ | ----------- | +| WORKSPACE_SETTING_KEY_UNSPECIFIED | 0 | | +| WORKSPACE_SETTING_AUTO_BACKUP | 1 | | + + + + + + + + + + ## Scalar Value Types | .proto Type | Notes | C++ | Java | Python | Go | C# | PHP | Ruby | diff --git a/proto/gen/store/workspace_setting.pb.go b/proto/gen/store/workspace_setting.pb.go new file mode 100644 index 0000000..ee20ee2 --- /dev/null +++ b/proto/gen/store/workspace_setting.pb.go @@ -0,0 +1,337 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc (unknown) +// source: store/workspace_setting.proto + +package store + +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) +) + +type WorkspaceSettingKey int32 + +const ( + WorkspaceSettingKey_WORKSPACE_SETTING_KEY_UNSPECIFIED WorkspaceSettingKey = 0 + WorkspaceSettingKey_WORKSPACE_SETTING_AUTO_BACKUP WorkspaceSettingKey = 1 +) + +// Enum value maps for WorkspaceSettingKey. +var ( + WorkspaceSettingKey_name = map[int32]string{ + 0: "WORKSPACE_SETTING_KEY_UNSPECIFIED", + 1: "WORKSPACE_SETTING_AUTO_BACKUP", + } + WorkspaceSettingKey_value = map[string]int32{ + "WORKSPACE_SETTING_KEY_UNSPECIFIED": 0, + "WORKSPACE_SETTING_AUTO_BACKUP": 1, + } +) + +func (x WorkspaceSettingKey) Enum() *WorkspaceSettingKey { + p := new(WorkspaceSettingKey) + *p = x + return p +} + +func (x WorkspaceSettingKey) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (WorkspaceSettingKey) Descriptor() protoreflect.EnumDescriptor { + return file_store_workspace_setting_proto_enumTypes[0].Descriptor() +} + +func (WorkspaceSettingKey) Type() protoreflect.EnumType { + return &file_store_workspace_setting_proto_enumTypes[0] +} + +func (x WorkspaceSettingKey) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use WorkspaceSettingKey.Descriptor instead. +func (WorkspaceSettingKey) EnumDescriptor() ([]byte, []int) { + return file_store_workspace_setting_proto_rawDescGZIP(), []int{0} +} + +type WorkspaceSetting struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Key WorkspaceSettingKey `protobuf:"varint,1,opt,name=key,proto3,enum=slash.store.WorkspaceSettingKey" json:"key,omitempty"` + // Types that are assignable to Value: + // + // *WorkspaceSetting_AutoBackup + Value isWorkspaceSetting_Value `protobuf_oneof:"value"` +} + +func (x *WorkspaceSetting) Reset() { + *x = WorkspaceSetting{} + if protoimpl.UnsafeEnabled { + mi := &file_store_workspace_setting_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *WorkspaceSetting) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*WorkspaceSetting) ProtoMessage() {} + +func (x *WorkspaceSetting) ProtoReflect() protoreflect.Message { + mi := &file_store_workspace_setting_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 WorkspaceSetting.ProtoReflect.Descriptor instead. +func (*WorkspaceSetting) Descriptor() ([]byte, []int) { + return file_store_workspace_setting_proto_rawDescGZIP(), []int{0} +} + +func (x *WorkspaceSetting) GetKey() WorkspaceSettingKey { + if x != nil { + return x.Key + } + return WorkspaceSettingKey_WORKSPACE_SETTING_KEY_UNSPECIFIED +} + +func (m *WorkspaceSetting) GetValue() isWorkspaceSetting_Value { + if m != nil { + return m.Value + } + return nil +} + +func (x *WorkspaceSetting) GetAutoBackup() *AutoBackupWorkspaceSetting { + if x, ok := x.GetValue().(*WorkspaceSetting_AutoBackup); ok { + return x.AutoBackup + } + return nil +} + +type isWorkspaceSetting_Value interface { + isWorkspaceSetting_Value() +} + +type WorkspaceSetting_AutoBackup struct { + AutoBackup *AutoBackupWorkspaceSetting `protobuf:"bytes,2,opt,name=auto_backup,json=autoBackup,proto3,oneof"` +} + +func (*WorkspaceSetting_AutoBackup) isWorkspaceSetting_Value() {} + +type AutoBackupWorkspaceSetting struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Whether auto backup is enabled. + Enabled bool `protobuf:"varint,1,opt,name=enabled,proto3" json:"enabled,omitempty"` + // The cron expression for auto backup. + // For example, "0 0 0 * * *" means backup at 00:00:00 every day. + // See https://en.wikipedia.org/wiki/Cron for more details. + CronExpression string `protobuf:"bytes,2,opt,name=cron_expression,json=cronExpression,proto3" json:"cron_expression,omitempty"` + // The maximum number of backups to keep. + MaxKeep int32 `protobuf:"varint,3,opt,name=max_keep,json=maxKeep,proto3" json:"max_keep,omitempty"` +} + +func (x *AutoBackupWorkspaceSetting) Reset() { + *x = AutoBackupWorkspaceSetting{} + if protoimpl.UnsafeEnabled { + mi := &file_store_workspace_setting_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AutoBackupWorkspaceSetting) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AutoBackupWorkspaceSetting) ProtoMessage() {} + +func (x *AutoBackupWorkspaceSetting) ProtoReflect() protoreflect.Message { + mi := &file_store_workspace_setting_proto_msgTypes[1] + 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 AutoBackupWorkspaceSetting.ProtoReflect.Descriptor instead. +func (*AutoBackupWorkspaceSetting) Descriptor() ([]byte, []int) { + return file_store_workspace_setting_proto_rawDescGZIP(), []int{1} +} + +func (x *AutoBackupWorkspaceSetting) GetEnabled() bool { + if x != nil { + return x.Enabled + } + return false +} + +func (x *AutoBackupWorkspaceSetting) GetCronExpression() string { + if x != nil { + return x.CronExpression + } + return "" +} + +func (x *AutoBackupWorkspaceSetting) GetMaxKeep() int32 { + if x != nil { + return x.MaxKeep + } + return 0 +} + +var File_store_workspace_setting_proto protoreflect.FileDescriptor + +var file_store_workspace_setting_proto_rawDesc = []byte{ + 0x0a, 0x1d, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2f, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, + 0x65, 0x5f, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, + 0x0b, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x22, 0x9b, 0x01, 0x0a, + 0x10, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, + 0x67, 0x12, 0x32, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x20, + 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x57, 0x6f, 0x72, + 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x4b, 0x65, 0x79, + 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x4a, 0x0a, 0x0b, 0x61, 0x75, 0x74, 0x6f, 0x5f, 0x62, 0x61, + 0x63, 0x6b, 0x75, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x73, 0x6c, 0x61, + 0x73, 0x68, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x41, 0x75, 0x74, 0x6f, 0x42, 0x61, 0x63, + 0x6b, 0x75, 0x70, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x53, 0x65, 0x74, 0x74, + 0x69, 0x6e, 0x67, 0x48, 0x00, 0x52, 0x0a, 0x61, 0x75, 0x74, 0x6f, 0x42, 0x61, 0x63, 0x6b, 0x75, + 0x70, 0x42, 0x07, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x7a, 0x0a, 0x1a, 0x41, 0x75, + 0x74, 0x6f, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, + 0x65, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x6e, 0x61, 0x62, + 0x6c, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, + 0x65, 0x64, 0x12, 0x27, 0x0a, 0x0f, 0x63, 0x72, 0x6f, 0x6e, 0x5f, 0x65, 0x78, 0x70, 0x72, 0x65, + 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x63, 0x72, 0x6f, + 0x6e, 0x45, 0x78, 0x70, 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x19, 0x0a, 0x08, 0x6d, + 0x61, 0x78, 0x5f, 0x6b, 0x65, 0x65, 0x70, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x6d, + 0x61, 0x78, 0x4b, 0x65, 0x65, 0x70, 0x2a, 0x5f, 0x0a, 0x13, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, + 0x61, 0x63, 0x65, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x4b, 0x65, 0x79, 0x12, 0x25, 0x0a, + 0x21, 0x57, 0x4f, 0x52, 0x4b, 0x53, 0x50, 0x41, 0x43, 0x45, 0x5f, 0x53, 0x45, 0x54, 0x54, 0x49, + 0x4e, 0x47, 0x5f, 0x4b, 0x45, 0x59, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, + 0x45, 0x44, 0x10, 0x00, 0x12, 0x21, 0x0a, 0x1d, 0x57, 0x4f, 0x52, 0x4b, 0x53, 0x50, 0x41, 0x43, + 0x45, 0x5f, 0x53, 0x45, 0x54, 0x54, 0x49, 0x4e, 0x47, 0x5f, 0x41, 0x55, 0x54, 0x4f, 0x5f, 0x42, + 0x41, 0x43, 0x4b, 0x55, 0x50, 0x10, 0x01, 0x42, 0x9f, 0x01, 0x0a, 0x0f, 0x63, 0x6f, 0x6d, 0x2e, + 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x42, 0x15, 0x57, 0x6f, 0x72, + 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x50, 0x72, 0x6f, + 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x28, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, + 0x2f, 0x62, 0x6f, 0x6f, 0x6a, 0x61, 0x63, 0x6b, 0x2f, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2f, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x73, 0x74, 0x6f, 0x72, 0x65, 0xa2, 0x02, + 0x03, 0x53, 0x53, 0x58, 0xaa, 0x02, 0x0b, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x53, 0x74, 0x6f, + 0x72, 0x65, 0xca, 0x02, 0x0b, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x5c, 0x53, 0x74, 0x6f, 0x72, 0x65, + 0xe2, 0x02, 0x17, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x5c, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x5c, 0x47, + 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0c, 0x53, 0x6c, 0x61, + 0x73, 0x68, 0x3a, 0x3a, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x33, +} + +var ( + file_store_workspace_setting_proto_rawDescOnce sync.Once + file_store_workspace_setting_proto_rawDescData = file_store_workspace_setting_proto_rawDesc +) + +func file_store_workspace_setting_proto_rawDescGZIP() []byte { + file_store_workspace_setting_proto_rawDescOnce.Do(func() { + file_store_workspace_setting_proto_rawDescData = protoimpl.X.CompressGZIP(file_store_workspace_setting_proto_rawDescData) + }) + return file_store_workspace_setting_proto_rawDescData +} + +var file_store_workspace_setting_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_store_workspace_setting_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_store_workspace_setting_proto_goTypes = []interface{}{ + (WorkspaceSettingKey)(0), // 0: slash.store.WorkspaceSettingKey + (*WorkspaceSetting)(nil), // 1: slash.store.WorkspaceSetting + (*AutoBackupWorkspaceSetting)(nil), // 2: slash.store.AutoBackupWorkspaceSetting +} +var file_store_workspace_setting_proto_depIdxs = []int32{ + 0, // 0: slash.store.WorkspaceSetting.key:type_name -> slash.store.WorkspaceSettingKey + 2, // 1: slash.store.WorkspaceSetting.auto_backup:type_name -> slash.store.AutoBackupWorkspaceSetting + 2, // [2:2] is the sub-list for method output_type + 2, // [2:2] is the sub-list for method input_type + 2, // [2:2] is the sub-list for extension type_name + 2, // [2:2] is the sub-list for extension extendee + 0, // [0:2] is the sub-list for field type_name +} + +func init() { file_store_workspace_setting_proto_init() } +func file_store_workspace_setting_proto_init() { + if File_store_workspace_setting_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_store_workspace_setting_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*WorkspaceSetting); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_store_workspace_setting_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AutoBackupWorkspaceSetting); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_store_workspace_setting_proto_msgTypes[0].OneofWrappers = []interface{}{ + (*WorkspaceSetting_AutoBackup)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_store_workspace_setting_proto_rawDesc, + NumEnums: 1, + NumMessages: 2, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_store_workspace_setting_proto_goTypes, + DependencyIndexes: file_store_workspace_setting_proto_depIdxs, + EnumInfos: file_store_workspace_setting_proto_enumTypes, + MessageInfos: file_store_workspace_setting_proto_msgTypes, + }.Build() + File_store_workspace_setting_proto = out.File + file_store_workspace_setting_proto_rawDesc = nil + file_store_workspace_setting_proto_goTypes = nil + file_store_workspace_setting_proto_depIdxs = nil +} diff --git a/proto/store/workspace_setting.proto b/proto/store/workspace_setting.proto new file mode 100644 index 0000000..e616a0c --- /dev/null +++ b/proto/store/workspace_setting.proto @@ -0,0 +1,30 @@ +syntax = "proto3"; + +package slash.store; + +option go_package = "gen/store"; + +message WorkspaceSetting { + WorkspaceSettingKey key = 1; + + oneof value { + AutoBackupWorkspaceSetting auto_backup = 2; + } +} + +enum WorkspaceSettingKey { + WORKSPACE_SETTING_KEY_UNSPECIFIED = 0; + + WORKSPACE_SETTING_AUTO_BACKUP = 1; +} + +message AutoBackupWorkspaceSetting { + // Whether auto backup is enabled. + bool enabled = 1; + // The cron expression for auto backup. + // For example, "0 0 0 * * *" means backup at 00:00:00 every day. + // See https://en.wikipedia.org/wiki/Cron for more details. + string cron_expression = 2; + // The maximum number of backups to keep. + int32 max_keep = 3; +}