Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

chore: add delete cache api (#5418)

ecmadao65c153c4739c
diff --git a/backend/api/v1/actuator_service.go b/backend/api/v1/actuator_service.go
index 9f814d3ca3..1b87894300 100644
--- a/backend/api/v1/actuator_service.go
+++ b/backend/api/v1/actuator_service.go
@@ -6,6 +6,7 @@ import (
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
+ "google.golang.org/protobuf/types/known/emptypb"
"google.golang.org/protobuf/types/known/timestamppb"
"github.com/bytebase/bytebase/backend/component/config"
@@ -34,6 +35,12 @@ func (s *ActuatorService) GetActuatorInfo(ctx context.Context, _ *v1pb.GetActuat
return s.getServerInfo(ctx)
}
+// DeleteCache deletes the cache.
+func (s *SettingService) DeleteCache(_ context.Context, _ *v1pb.DeleteCacheRequest) (*emptypb.Empty, error) {
+ s.store.DeleteCache()
+ return &emptypb.Empty{}, nil
+}
+
func (s *ActuatorService) getServerInfo(ctx context.Context) (*v1pb.ActuatorInfo, error) {
count, err := s.store.CountUsers(ctx, api.EndUser)
if err != nil {
diff --git a/backend/store/setting.go b/backend/store/setting.go
index eac168aec7..ab0e3dea36 100644
--- a/backend/store/setting.go
+++ b/backend/store/setting.go
@@ -5,6 +5,7 @@ import (
"database/sql"
"fmt"
"strings"
+ "sync"
"github.com/pkg/errors"
"google.golang.org/protobuf/encoding/protojson"
@@ -94,6 +95,11 @@ func (s *Store) PatchSetting(ctx context.Context, patch *api.SettingPatch) (*api
return setting.toAPISetting(), nil
}
+// DeleteCache deletes the cache.
+func (s *Store) DeleteCache() {
+ s.settingCache = sync.Map{}
+}
+
// FindSettingMessage is the message for finding setting.
type FindSettingMessage struct {
Name *api.SettingName
diff --git a/frontend/src/types/proto/v1/actuator_service.ts b/frontend/src/types/proto/v1/actuator_service.ts
index 180f330190..d515a178a4 100644
--- a/frontend/src/types/proto/v1/actuator_service.ts
+++ b/frontend/src/types/proto/v1/actuator_service.ts
@@ -1,6 +1,7 @@
/* eslint-disable */
import type { CallContext, CallOptions } from "nice-grpc-common";
import * as _m0 from "protobufjs/minimal";
+import { Empty } from "../google/protobuf/empty";
import { Timestamp } from "../google/protobuf/timestamp";
export const protobufPackage = "bytebase.v1";
@@ -8,6 +9,9 @@ export const protobufPackage = "bytebase.v1";
export interface GetActuatorInfoRequest {
}
+export interface DeleteCacheRequest {
+}
+
/**
* ServerInfo is the API message for server info.
* Actuator concept is similar to the Spring Boot Actuator.
@@ -81,6 +85,50 @@ export const GetActuatorInfoRequest = {
},
};
+function createBaseDeleteCacheRequest(): DeleteCacheRequest {
+ return {};
+}
+
+export const DeleteCacheRequest = {
+ encode(_: DeleteCacheRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
+ return writer;
+ },
+
+ decode(input: _m0.Reader | Uint8Array, length?: number): DeleteCacheRequest {
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
+ let end = length === undefined ? reader.len : reader.pos + length;
+ const message = createBaseDeleteCacheRequest();
+ while (reader.pos < end) {
+ const tag = reader.uint32();
+ switch (tag >>> 3) {
+ }
+ if ((tag & 7) == 4 || tag == 0) {
+ break;
+ }
+ reader.skipType(tag & 7);
+ }
+ return message;
+ },
+
+ fromJSON(_: any): DeleteCacheRequest {
+ return {};
+ },
+
+ toJSON(_: DeleteCacheRequest): unknown {
+ const obj: any = {};
+ return obj;
+ },
+
+ create(base?: DeepPartial<DeleteCacheRequest>): DeleteCacheRequest {
+ return DeleteCacheRequest.fromPartial(base ?? {});
+ },
+
+ fromPartial(_: DeepPartial<DeleteCacheRequest>): DeleteCacheRequest {
+ const message = createBaseDeleteCacheRequest();
+ return message;
+ },
+};
+
function createBaseActuatorInfo(): ActuatorInfo {
return {
version: "",
@@ -301,6 +349,42 @@ export const ActuatorServiceDefinition = {
},
},
},
+ deleteCache: {
+ name: "DeleteCache",
+ requestType: DeleteCacheRequest,
+ requestStream: false,
+ responseType: Empty,
+ responseStream: false,
+ options: {
+ _unknownFields: {
+ 578365826: [
+ new Uint8Array([
+ 20,
+ 42,
+ 18,
+ 47,
+ 118,
+ 49,
+ 47,
+ 97,
+ 99,
+ 116,
+ 117,
+ 97,
+ 116,
+ 111,
+ 114,
+ 47,
+ 99,
+ 97,
+ 99,
+ 104,
+ 101,
+ ]),
+ ],
+ },
+ },
+ },
},
} as const;
@@ -309,6 +393,7 @@ export interface ActuatorServiceImplementation<CallContextExt = {}> {
request: GetActuatorInfoRequest,
context: CallContext & CallContextExt,
): Promise<DeepPartial<ActuatorInfo>>;
+ deleteCache(request: DeleteCacheRequest, context: CallContext & CallContextExt): Promise<DeepPartial<Empty>>;
}
export interface ActuatorServiceClient<CallOptionsExt = {}> {
@@ -316,6 +401,7 @@ export interface ActuatorServiceClient<CallOptionsExt = {}> {
request: DeepPartial<GetActuatorInfoRequest>,
options?: CallOptions & CallOptionsExt,
): Promise<ActuatorInfo>;
+ deleteCache(request: DeepPartial<DeleteCacheRequest>, options?: CallOptions & CallOptionsExt): Promise<Empty>;
}
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
diff --git a/proto/gen/grpc-doc/v1/README.md b/proto/gen/grpc-doc/v1/README.md
index 4d8dc440ff..dab815eeb0 100644
--- a/proto/gen/grpc-doc/v1/README.md
+++ b/proto/gen/grpc-doc/v1/README.md
@@ -5,6 +5,7 @@
- [v1/actuator_service.proto](#v1_actuator_service-proto)
- [ActuatorInfo](#bytebase-v1-ActuatorInfo)
+ - [DeleteCacheRequest](#bytebase-v1-DeleteCacheRequest)
- [GetActuatorInfoRequest](#bytebase-v1-GetActuatorInfoRequest)
- [ActuatorService](#bytebase-v1-ActuatorService)
@@ -364,6 +365,16 @@ Actuator concept is similar to the Spring Boot Actuator.
+<a name="bytebase-v1-DeleteCacheRequest"></a>
+
+### DeleteCacheRequest
+
+
+
+
+
+
+
<a name="bytebase-v1-GetActuatorInfoRequest"></a>
### GetActuatorInfoRequest
@@ -388,6 +399,7 @@ Actuator concept is similar to the Spring Boot Actuator.
| Method Name | Request Type | Response Type | Description |
| ----------- | ------------ | ------------- | ------------|
| GetActuatorInfo | [GetActuatorInfoRequest](#bytebase-v1-GetActuatorInfoRequest) | [ActuatorInfo](#bytebase-v1-ActuatorInfo) | |
+| DeleteCache | [DeleteCacheRequest](#bytebase-v1-DeleteCacheRequest) | [.google.protobuf.Empty](#google-protobuf-Empty) | |
diff --git a/proto/generated-go/v1/actuator_service.pb.go b/proto/generated-go/v1/actuator_service.pb.go
index a5641fe068..b8127f272c 100644
--- a/proto/generated-go/v1/actuator_service.pb.go
+++ b/proto/generated-go/v1/actuator_service.pb.go
@@ -10,7 +10,7 @@ import (
_ "google.golang.org/genproto/googleapis/api/annotations"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
- _ "google.golang.org/protobuf/types/known/emptypb"
+ emptypb "google.golang.org/protobuf/types/known/emptypb"
timestamppb "google.golang.org/protobuf/types/known/timestamppb"
reflect "reflect"
sync "sync"
@@ -61,6 +61,44 @@ func (*GetActuatorInfoRequest) Descriptor() ([]byte, []int) {
return file_v1_actuator_service_proto_rawDescGZIP(), []int{0}
}
+type DeleteCacheRequest struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+}
+
+func (x *DeleteCacheRequest) Reset() {
+ *x = DeleteCacheRequest{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_v1_actuator_service_proto_msgTypes[1]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *DeleteCacheRequest) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*DeleteCacheRequest) ProtoMessage() {}
+
+func (x *DeleteCacheRequest) ProtoReflect() protoreflect.Message {
+ mi := &file_v1_actuator_service_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 DeleteCacheRequest.ProtoReflect.Descriptor instead.
+func (*DeleteCacheRequest) Descriptor() ([]byte, []int) {
+ return file_v1_actuator_service_proto_rawDescGZIP(), []int{1}
+}
+
// ServerInfo is the API message for server info.
// Actuator concept is similar to the Spring Boot Actuator.
type ActuatorInfo struct {
@@ -95,7 +133,7 @@ type ActuatorInfo struct {
func (x *ActuatorInfo) Reset() {
*x = ActuatorInfo{}
if protoimpl.UnsafeEnabled {
- mi := &file_v1_actuator_service_proto_msgTypes[1]
+ mi := &file_v1_actuator_service_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -108,7 +146,7 @@ func (x *ActuatorInfo) String() string {
func (*ActuatorInfo) ProtoMessage() {}
func (x *ActuatorInfo) ProtoReflect() protoreflect.Message {
- mi := &file_v1_actuator_service_proto_msgTypes[1]
+ mi := &file_v1_actuator_service_proto_msgTypes[2]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -121,7 +159,7 @@ func (x *ActuatorInfo) ProtoReflect() protoreflect.Message {
// Deprecated: Use ActuatorInfo.ProtoReflect.Descriptor instead.
func (*ActuatorInfo) Descriptor() ([]byte, []int) {
- return file_v1_actuator_service_proto_rawDescGZIP(), []int{1}
+ return file_v1_actuator_service_proto_rawDescGZIP(), []int{2}
}
func (x *ActuatorInfo) GetVersion() string {
@@ -217,44 +255,52 @@ var file_v1_actuator_service_proto_rawDesc = []byte{
0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74,
0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x18,
0x0a, 0x16, 0x47, 0x65, 0x74, 0x41, 0x63, 0x74, 0x75, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x66,
- 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0xaf, 0x03, 0x0a, 0x0c, 0x41, 0x63, 0x74,
- 0x75, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x1d, 0x0a, 0x07, 0x76, 0x65, 0x72,
- 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52,
- 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x22, 0x0a, 0x0a, 0x67, 0x69, 0x74, 0x5f,
- 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41,
- 0x03, 0x52, 0x09, 0x67, 0x69, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x12, 0x1f, 0x0a, 0x08,
- 0x72, 0x65, 0x61, 0x64, 0x6f, 0x6e, 0x6c, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x42, 0x03,
- 0xe0, 0x41, 0x03, 0x52, 0x08, 0x72, 0x65, 0x61, 0x64, 0x6f, 0x6e, 0x6c, 0x79, 0x12, 0x17, 0x0a,
- 0x04, 0x73, 0x61, 0x61, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x42, 0x03, 0xe0, 0x41, 0x03,
- 0x52, 0x04, 0x73, 0x61, 0x61, 0x73, 0x12, 0x20, 0x0a, 0x09, 0x64, 0x65, 0x6d, 0x6f, 0x5f, 0x6e,
- 0x61, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x08,
- 0x64, 0x65, 0x6d, 0x6f, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x17, 0x0a, 0x04, 0x68, 0x6f, 0x73, 0x74,
- 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x04, 0x68, 0x6f, 0x73,
- 0x74, 0x12, 0x17, 0x0a, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x42,
- 0x03, 0xe0, 0x41, 0x03, 0x52, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x26, 0x0a, 0x0c, 0x65, 0x78,
- 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09,
- 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x0b, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x55,
- 0x72, 0x6c, 0x12, 0x2d, 0x0a, 0x10, 0x6e, 0x65, 0x65, 0x64, 0x5f, 0x61, 0x64, 0x6d, 0x69, 0x6e,
- 0x5f, 0x73, 0x65, 0x74, 0x75, 0x70, 0x18, 0x09, 0x20, 0x01, 0x28, 0x08, 0x42, 0x03, 0xe0, 0x41,
- 0x03, 0x52, 0x0e, 0x6e, 0x65, 0x65, 0x64, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x53, 0x65, 0x74, 0x75,
- 0x70, 0x12, 0x2c, 0x0a, 0x0f, 0x64, 0x69, 0x73, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x5f, 0x73, 0x69,
- 0x67, 0x6e, 0x75, 0x70, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x08, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52,
- 0x0e, 0x64, 0x69, 0x73, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x53, 0x69, 0x67, 0x6e, 0x75, 0x70, 0x12,
- 0x49, 0x0a, 0x10, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x74,
- 0x69, 0x6d, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67,
- 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65,
- 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x0e, 0x6c, 0x61, 0x73, 0x74,
- 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x32, 0x82, 0x01, 0x0a, 0x0f, 0x41,
- 0x63, 0x74, 0x75, 0x61, 0x74, 0x6f, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x6f,
- 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x41, 0x63, 0x74, 0x75, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x66,
- 0x6f, 0x12, 0x23, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e,
- 0x47, 0x65, 0x74, 0x41, 0x63, 0x74, 0x75, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52,
- 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73,
- 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x63, 0x74, 0x75, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x66,
- 0x6f, 0x22, 0x1c, 0xda, 0x41, 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x13, 0x12, 0x11, 0x2f, 0x76,
- 0x31, 0x2f, 0x61, 0x63, 0x74, 0x75, 0x61, 0x74, 0x6f, 0x72, 0x2f, 0x69, 0x6e, 0x66, 0x6f, 0x42,
- 0x11, 0x5a, 0x0f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2d, 0x67, 0x6f, 0x2f,
- 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
+ 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x14, 0x0a, 0x12, 0x44, 0x65, 0x6c, 0x65,
+ 0x74, 0x65, 0x43, 0x61, 0x63, 0x68, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0xaf,
+ 0x03, 0x0a, 0x0c, 0x41, 0x63, 0x74, 0x75, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x12,
+ 0x1d, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09,
+ 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x22,
+ 0x0a, 0x0a, 0x67, 0x69, 0x74, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x18, 0x02, 0x20, 0x01,
+ 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x09, 0x67, 0x69, 0x74, 0x43, 0x6f, 0x6d, 0x6d,
+ 0x69, 0x74, 0x12, 0x1f, 0x0a, 0x08, 0x72, 0x65, 0x61, 0x64, 0x6f, 0x6e, 0x6c, 0x79, 0x18, 0x03,
+ 0x20, 0x01, 0x28, 0x08, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x08, 0x72, 0x65, 0x61, 0x64, 0x6f,
+ 0x6e, 0x6c, 0x79, 0x12, 0x17, 0x0a, 0x04, 0x73, 0x61, 0x61, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28,
+ 0x08, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x04, 0x73, 0x61, 0x61, 0x73, 0x12, 0x20, 0x0a, 0x09,
+ 0x64, 0x65, 0x6d, 0x6f, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x42,
+ 0x03, 0xe0, 0x41, 0x03, 0x52, 0x08, 0x64, 0x65, 0x6d, 0x6f, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x17,
+ 0x0a, 0x04, 0x68, 0x6f, 0x73, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41,
+ 0x03, 0x52, 0x04, 0x68, 0x6f, 0x73, 0x74, 0x12, 0x17, 0x0a, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x18,
+ 0x07, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x04, 0x70, 0x6f, 0x72, 0x74,
+ 0x12, 0x26, 0x0a, 0x0c, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x5f, 0x75, 0x72, 0x6c,
+ 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x0b, 0x65, 0x78, 0x74,
+ 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x55, 0x72, 0x6c, 0x12, 0x2d, 0x0a, 0x10, 0x6e, 0x65, 0x65, 0x64,
+ 0x5f, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x5f, 0x73, 0x65, 0x74, 0x75, 0x70, 0x18, 0x09, 0x20, 0x01,
+ 0x28, 0x08, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x0e, 0x6e, 0x65, 0x65, 0x64, 0x41, 0x64, 0x6d,
+ 0x69, 0x6e, 0x53, 0x65, 0x74, 0x75, 0x70, 0x12, 0x2c, 0x0a, 0x0f, 0x64, 0x69, 0x73, 0x61, 0x6c,
+ 0x6c, 0x6f, 0x77, 0x5f, 0x73, 0x69, 0x67, 0x6e, 0x75, 0x70, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x08,
+ 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x0e, 0x64, 0x69, 0x73, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x53,
+ 0x69, 0x67, 0x6e, 0x75, 0x70, 0x12, 0x49, 0x0a, 0x10, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x61, 0x63,
+ 0x74, 0x69, 0x76, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32,
+ 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75,
+ 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x03, 0xe0, 0x41, 0x03,
+ 0x52, 0x0e, 0x6c, 0x61, 0x73, 0x74, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x54, 0x69, 0x6d, 0x65,
+ 0x32, 0xe6, 0x01, 0x0a, 0x0f, 0x41, 0x63, 0x74, 0x75, 0x61, 0x74, 0x6f, 0x72, 0x53, 0x65, 0x72,
+ 0x76, 0x69, 0x63, 0x65, 0x12, 0x6f, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x41, 0x63, 0x74, 0x75, 0x61,
+ 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x23, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61,
+ 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x41, 0x63, 0x74, 0x75, 0x61, 0x74, 0x6f,
+ 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x62,
+ 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x63, 0x74, 0x75, 0x61,
+ 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x22, 0x1c, 0xda, 0x41, 0x00, 0x82, 0xd3, 0xe4, 0x93,
+ 0x02, 0x13, 0x12, 0x11, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x63, 0x74, 0x75, 0x61, 0x74, 0x6f, 0x72,
+ 0x2f, 0x69, 0x6e, 0x66, 0x6f, 0x12, 0x62, 0x0a, 0x0b, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x43,
+ 0x61, 0x63, 0x68, 0x65, 0x12, 0x1f, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e,
+ 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x43, 0x61, 0x63, 0x68, 0x65, 0x52, 0x65,
+ 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70,
+ 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x1a, 0x82,
+ 0xd3, 0xe4, 0x93, 0x02, 0x14, 0x2a, 0x12, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x63, 0x74, 0x75, 0x61,
+ 0x74, 0x6f, 0x72, 0x2f, 0x63, 0x61, 0x63, 0x68, 0x65, 0x42, 0x11, 0x5a, 0x0f, 0x67, 0x65, 0x6e,
+ 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2d, 0x67, 0x6f, 0x2f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72,
+ 0x6f, 0x74, 0x6f, 0x33,
}
var (
@@ -269,18 +315,22 @@ func file_v1_actuator_service_proto_rawDescGZIP() []byte {
return file_v1_actuator_service_proto_rawDescData
}
-var file_v1_actuator_service_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
+var file_v1_actuator_service_proto_msgTypes = make([]protoimpl.MessageInfo, 3)
var file_v1_actuator_service_proto_goTypes = []interface{}{
(*GetActuatorInfoRequest)(nil), // 0: bytebase.v1.GetActuatorInfoRequest
- (*ActuatorInfo)(nil), // 1: bytebase.v1.ActuatorInfo
- (*timestamppb.Timestamp)(nil), // 2: google.protobuf.Timestamp
+ (*DeleteCacheRequest)(nil), // 1: bytebase.v1.DeleteCacheRequest
+ (*ActuatorInfo)(nil), // 2: bytebase.v1.ActuatorInfo
+ (*timestamppb.Timestamp)(nil), // 3: google.protobuf.Timestamp
+ (*emptypb.Empty)(nil), // 4: google.protobuf.Empty
}
var file_v1_actuator_service_proto_depIdxs = []int32{
- 2, // 0: bytebase.v1.ActuatorInfo.last_active_time:type_name -> google.protobuf.Timestamp
+ 3, // 0: bytebase.v1.ActuatorInfo.last_active_time:type_name -> google.protobuf.Timestamp
0, // 1: bytebase.v1.ActuatorService.GetActuatorInfo:input_type -> bytebase.v1.GetActuatorInfoRequest
- 1, // 2: bytebase.v1.ActuatorService.GetActuatorInfo:output_type -> bytebase.v1.ActuatorInfo
- 2, // [2:3] is the sub-list for method output_type
- 1, // [1:2] is the sub-list for method input_type
+ 1, // 2: bytebase.v1.ActuatorService.DeleteCache:input_type -> bytebase.v1.DeleteCacheRequest
+ 2, // 3: bytebase.v1.ActuatorService.GetActuatorInfo:output_type -> bytebase.v1.ActuatorInfo
+ 4, // 4: bytebase.v1.ActuatorService.DeleteCache:output_type -> google.protobuf.Empty
+ 3, // [3:5] is the sub-list for method output_type
+ 1, // [1:3] is the sub-list for method input_type
1, // [1:1] is the sub-list for extension type_name
1, // [1:1] is the sub-list for extension extendee
0, // [0:1] is the sub-list for field type_name
@@ -305,6 +355,18 @@ func file_v1_actuator_service_proto_init() {
}
}
file_v1_actuator_service_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*DeleteCacheRequest); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_v1_actuator_service_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ActuatorInfo); i {
case 0:
return &v.state
@@ -323,7 +385,7 @@ func file_v1_actuator_service_proto_init() {
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_v1_actuator_service_proto_rawDesc,
NumEnums: 0,
- NumMessages: 2,
+ NumMessages: 3,
NumExtensions: 0,
NumServices: 1,
},
diff --git a/proto/generated-go/v1/actuator_service.pb.gw.go b/proto/generated-go/v1/actuator_service.pb.gw.go
index 26c8a4a4b9..5ada68e7ba 100644
--- a/proto/generated-go/v1/actuator_service.pb.gw.go
+++ b/proto/generated-go/v1/actuator_service.pb.gw.go
@@ -49,6 +49,24 @@ func local_request_ActuatorService_GetActuatorInfo_0(ctx context.Context, marsha
}
+func request_ActuatorService_DeleteCache_0(ctx context.Context, marshaler runtime.Marshaler, client ActuatorServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
+ var protoReq DeleteCacheRequest
+ var metadata runtime.ServerMetadata
+
+ msg, err := client.DeleteCache(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
+ return msg, metadata, err
+
+}
+
+func local_request_ActuatorService_DeleteCache_0(ctx context.Context, marshaler runtime.Marshaler, server ActuatorServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
+ var protoReq DeleteCacheRequest
+ var metadata runtime.ServerMetadata
+
+ msg, err := server.DeleteCache(ctx, &protoReq)
+ return msg, metadata, err
+
+}
+
// RegisterActuatorServiceHandlerServer registers the http handlers for service ActuatorService to "mux".
// UnaryRPC :call ActuatorServiceServer directly.
// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.
@@ -80,6 +98,31 @@ func RegisterActuatorServiceHandlerServer(ctx context.Context, mux *runtime.Serv
})
+ mux.Handle("DELETE", pattern_ActuatorService_DeleteCache_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
+ ctx, cancel := context.WithCancel(req.Context())
+ defer cancel()
+ var stream runtime.ServerTransportStream
+ ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
+ inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
+ var err error
+ var annotatedContext context.Context
+ annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/bytebase.v1.ActuatorService/DeleteCache", runtime.WithHTTPPathPattern("/v1/actuator/cache"))
+ if err != nil {
+ runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
+ return
+ }
+ resp, md, err := local_request_ActuatorService_DeleteCache_0(annotatedContext, inboundMarshaler, server, req, pathParams)
+ md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
+ annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
+ if err != nil {
+ runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
+ return
+ }
+
+ forward_ActuatorService_DeleteCache_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
+
+ })
+
return nil
}
@@ -143,13 +186,39 @@ func RegisterActuatorServiceHandlerClient(ctx context.Context, mux *runtime.Serv
})
+ mux.Handle("DELETE", pattern_ActuatorService_DeleteCache_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
+ ctx, cancel := context.WithCancel(req.Context())
+ defer cancel()
+ inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
+ var err error
+ var annotatedContext context.Context
+ annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/bytebase.v1.ActuatorService/DeleteCache", runtime.WithHTTPPathPattern("/v1/actuator/cache"))
+ if err != nil {
+ runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
+ return
+ }
+ resp, md, err := request_ActuatorService_DeleteCache_0(annotatedContext, inboundMarshaler, client, req, pathParams)
+ annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
+ if err != nil {
+ runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
+ return
+ }
+
+ forward_ActuatorService_DeleteCache_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
+
+ })
+
return nil
}
var (
pattern_ActuatorService_GetActuatorInfo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "actuator", "info"}, ""))
+
+ pattern_ActuatorService_DeleteCache_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "actuator", "cache"}, ""))
)
var (
forward_ActuatorService_GetActuatorInfo_0 = runtime.ForwardResponseMessage
+
+ forward_ActuatorService_DeleteCache_0 = runtime.ForwardResponseMessage
)
diff --git a/proto/generated-go/v1/actuator_service_grpc.pb.go b/proto/generated-go/v1/actuator_service_grpc.pb.go
index 418d517d97..abb5528ab7 100644
--- a/proto/generated-go/v1/actuator_service_grpc.pb.go
+++ b/proto/generated-go/v1/actuator_service_grpc.pb.go
@@ -11,6 +11,7 @@ import (
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
+ emptypb "google.golang.org/protobuf/types/known/emptypb"
)
// This is a compile-time assertion to ensure that this generated file
@@ -20,6 +21,7 @@ const _ = grpc.SupportPackageIsVersion7
const (
ActuatorService_GetActuatorInfo_FullMethodName = "/bytebase.v1.ActuatorService/GetActuatorInfo"
+ ActuatorService_DeleteCache_FullMethodName = "/bytebase.v1.ActuatorService/DeleteCache"
)
// ActuatorServiceClient is the client API for ActuatorService service.
@@ -27,6 +29,7 @@ const (
// 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 ActuatorServiceClient interface {
GetActuatorInfo(ctx context.Context, in *GetActuatorInfoRequest, opts ...grpc.CallOption) (*ActuatorInfo, error)
+ DeleteCache(ctx context.Context, in *DeleteCacheRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
}
type actuatorServiceClient struct {
@@ -46,11 +49,21 @@ func (c *actuatorServiceClient) GetActuatorInfo(ctx context.Context, in *GetActu
return out, nil
}
+func (c *actuatorServiceClient) DeleteCache(ctx context.Context, in *DeleteCacheRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
+ out := new(emptypb.Empty)
+ err := c.cc.Invoke(ctx, ActuatorService_DeleteCache_FullMethodName, in, out, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
// ActuatorServiceServer is the server API for ActuatorService service.
// All implementations must embed UnimplementedActuatorServiceServer
// for forward compatibility
type ActuatorServiceServer interface {
GetActuatorInfo(context.Context, *GetActuatorInfoRequest) (*ActuatorInfo, error)
+ DeleteCache(context.Context, *DeleteCacheRequest) (*emptypb.Empty, error)
mustEmbedUnimplementedActuatorServiceServer()
}
@@ -61,6 +74,9 @@ type UnimplementedActuatorServiceServer struct {
func (UnimplementedActuatorServiceServer) GetActuatorInfo(context.Context, *GetActuatorInfoRequest) (*ActuatorInfo, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetActuatorInfo not implemented")
}
+func (UnimplementedActuatorServiceServer) DeleteCache(context.Context, *DeleteCacheRequest) (*emptypb.Empty, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method DeleteCache not implemented")
+}
func (UnimplementedActuatorServiceServer) mustEmbedUnimplementedActuatorServiceServer() {}
// UnsafeActuatorServiceServer may be embedded to opt out of forward compatibility for this service.
@@ -92,6 +108,24 @@ func _ActuatorService_GetActuatorInfo_Handler(srv interface{}, ctx context.Conte
return interceptor(ctx, in, info, handler)
}
+func _ActuatorService_DeleteCache_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+ in := new(DeleteCacheRequest)
+ if err := dec(in); err != nil {
+ return nil, err
+ }
+ if interceptor == nil {
+ return srv.(ActuatorServiceServer).DeleteCache(ctx, in)
+ }
+ info := &grpc.UnaryServerInfo{
+ Server: srv,
+ FullMethod: ActuatorService_DeleteCache_FullMethodName,
+ }
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+ return srv.(ActuatorServiceServer).DeleteCache(ctx, req.(*DeleteCacheRequest))
+ }
+ return interceptor(ctx, in, info, handler)
+}
+
// ActuatorService_ServiceDesc is the grpc.ServiceDesc for ActuatorService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
@@ -103,6 +137,10 @@ var ActuatorService_ServiceDesc = grpc.ServiceDesc{
MethodName: "GetActuatorInfo",
Handler: _ActuatorService_GetActuatorInfo_Handler,
},
+ {
+ MethodName: "DeleteCache",
+ Handler: _ActuatorService_DeleteCache_Handler,
+ },
},
Streams: []grpc.StreamDesc{},
Metadata: "v1/actuator_service.proto",
diff --git a/proto/v1/actuator_service.proto b/proto/v1/actuator_service.proto
index 7e0942a9e9..b5bac378b2 100644
--- a/proto/v1/actuator_service.proto
+++ b/proto/v1/actuator_service.proto
@@ -15,10 +15,18 @@ service ActuatorService {
option (google.api.http) = {get: "/v1/actuator/info"};
option (google.api.method_signature) = "";
}
+
+ rpc DeleteCache(DeleteCacheRequest) returns (google.protobuf.Empty) {
+ option (google.api.http) = {
+ delete: "/v1/actuator/cache"
+ };
+ }
}
message GetActuatorInfoRequest {}
+message DeleteCacheRequest {}
+
// ServerInfo is the API message for server info.
// Actuator concept is similar to the Spring Boot Actuator.
message ActuatorInfo {