From 4d0e67b89cf7d06d97659042afa9c41d1694dcfd Mon Sep 17 00:00:00 2001 From: Nima Kaviani Date: Tue, 29 Sep 2020 14:30:06 -0700 Subject: [PATCH] feat(storage): add redis and sql to storage options --- api/client/storage/redis.pb.go | 178 ++++++++++++++++ api/client/storage/sql.pb.go | 374 +++++++++++++++++++++++++++++++++ api/proto/storage/redis.proto | 17 ++ api/proto/storage/sql.proto | 40 ++++ docs/docs.md | 109 ++++++++++ 5 files changed, 718 insertions(+) create mode 100644 api/client/storage/redis.pb.go create mode 100644 api/client/storage/sql.pb.go create mode 100644 api/proto/storage/redis.proto create mode 100644 api/proto/storage/sql.proto diff --git a/api/client/storage/redis.pb.go b/api/client/storage/redis.pb.go new file mode 100644 index 00000000..7e451a24 --- /dev/null +++ b/api/client/storage/redis.pb.go @@ -0,0 +1,178 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0 +// protoc v3.13.0 +// source: storage/redis.proto + +package storage + +import ( + proto "github.com/golang/protobuf/proto" + wrappers "github.com/golang/protobuf/ptypes/wrappers" + 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) +) + +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + +type Redis struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Whether this persistent store is enabled. + Enabled *wrappers.BoolValue `protobuf:"bytes,1,opt,name=enabled,proto3" json:"enabled,omitempty"` + // The host for the redis server + Host string `protobuf:"bytes,2,opt,name=host,proto3" json:"host,omitempty"` + // The port for the redis server + Port int32 `protobuf:"varint,3,opt,name=port,proto3" json:"port,omitempty"` +} + +func (x *Redis) Reset() { + *x = Redis{} + if protoimpl.UnsafeEnabled { + mi := &file_storage_redis_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Redis) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Redis) ProtoMessage() {} + +func (x *Redis) ProtoReflect() protoreflect.Message { + mi := &file_storage_redis_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 Redis.ProtoReflect.Descriptor instead. +func (*Redis) Descriptor() ([]byte, []int) { + return file_storage_redis_proto_rawDescGZIP(), []int{0} +} + +func (x *Redis) GetEnabled() *wrappers.BoolValue { + if x != nil { + return x.Enabled + } + return nil +} + +func (x *Redis) GetHost() string { + if x != nil { + return x.Host + } + return "" +} + +func (x *Redis) GetPort() int32 { + if x != nil { + return x.Port + } + return 0 +} + +var File_storage_redis_proto protoreflect.FileDescriptor + +var file_storage_redis_proto_rawDesc = []byte{ + 0x0a, 0x13, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2f, 0x72, 0x65, 0x64, 0x69, 0x73, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0d, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x73, 0x74, 0x6f, + 0x72, 0x61, 0x67, 0x65, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x77, 0x72, 0x61, 0x70, 0x70, 0x65, 0x72, 0x73, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x65, 0x0a, 0x05, 0x52, 0x65, 0x64, 0x69, 0x73, 0x12, 0x34, 0x0a, + 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2e, 0x42, 0x6f, 0x6f, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x07, 0x65, 0x6e, 0x61, 0x62, + 0x6c, 0x65, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x68, 0x6f, 0x73, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x04, 0x68, 0x6f, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x42, 0x2f, 0x5a, 0x2d, 0x67, + 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x73, 0x70, 0x69, 0x6e, 0x6e, 0x61, + 0x6b, 0x65, 0x72, 0x2f, 0x6b, 0x6c, 0x65, 0x61, 0x74, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6c, + 0x69, 0x65, 0x6e, 0x74, 0x2f, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_storage_redis_proto_rawDescOnce sync.Once + file_storage_redis_proto_rawDescData = file_storage_redis_proto_rawDesc +) + +func file_storage_redis_proto_rawDescGZIP() []byte { + file_storage_redis_proto_rawDescOnce.Do(func() { + file_storage_redis_proto_rawDescData = protoimpl.X.CompressGZIP(file_storage_redis_proto_rawDescData) + }) + return file_storage_redis_proto_rawDescData +} + +var file_storage_redis_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_storage_redis_proto_goTypes = []interface{}{ + (*Redis)(nil), // 0: proto.storage.Redis + (*wrappers.BoolValue)(nil), // 1: google.protobuf.BoolValue +} +var file_storage_redis_proto_depIdxs = []int32{ + 1, // 0: proto.storage.Redis.enabled:type_name -> google.protobuf.BoolValue + 1, // [1:1] is the sub-list for method output_type + 1, // [1:1] 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 +} + +func init() { file_storage_redis_proto_init() } +func file_storage_redis_proto_init() { + if File_storage_redis_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_storage_redis_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Redis); 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_storage_redis_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_storage_redis_proto_goTypes, + DependencyIndexes: file_storage_redis_proto_depIdxs, + MessageInfos: file_storage_redis_proto_msgTypes, + }.Build() + File_storage_redis_proto = out.File + file_storage_redis_proto_rawDesc = nil + file_storage_redis_proto_goTypes = nil + file_storage_redis_proto_depIdxs = nil +} diff --git a/api/client/storage/sql.pb.go b/api/client/storage/sql.pb.go new file mode 100644 index 00000000..ab6b47bf --- /dev/null +++ b/api/client/storage/sql.pb.go @@ -0,0 +1,374 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0 +// protoc v3.13.0 +// source: storage/sql.proto + +package storage + +import ( + proto "github.com/golang/protobuf/proto" + wrappers "github.com/golang/protobuf/ptypes/wrappers" + 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) +) + +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + +type SQL struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Whether this persistent store is enabled. + Enabled *wrappers.BoolValue `protobuf:"bytes,1,opt,name=enabled,proto3" json:"enabled,omitempty"` + // Default database connection pool. + ConnectionPools *SQL_ConnectionPools `protobuf:"bytes,2,opt,name=connectionPools,proto3" json:"connectionPools,omitempty"` + // Migration connection pool + Migration *SQL_ConnectionPool `protobuf:"bytes,3,opt,name=migration,proto3" json:"migration,omitempty"` +} + +func (x *SQL) Reset() { + *x = SQL{} + if protoimpl.UnsafeEnabled { + mi := &file_storage_sql_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SQL) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SQL) ProtoMessage() {} + +func (x *SQL) ProtoReflect() protoreflect.Message { + mi := &file_storage_sql_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 SQL.ProtoReflect.Descriptor instead. +func (*SQL) Descriptor() ([]byte, []int) { + return file_storage_sql_proto_rawDescGZIP(), []int{0} +} + +func (x *SQL) GetEnabled() *wrappers.BoolValue { + if x != nil { + return x.Enabled + } + return nil +} + +func (x *SQL) GetConnectionPools() *SQL_ConnectionPools { + if x != nil { + return x.ConnectionPools + } + return nil +} + +func (x *SQL) GetMigration() *SQL_ConnectionPool { + if x != nil { + return x.Migration + } + return nil +} + +// The default connection pool +type SQL_ConnectionPools struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Default *SQL_ConnectionPool `protobuf:"bytes,1,opt,name=default,proto3" json:"default,omitempty"` +} + +func (x *SQL_ConnectionPools) Reset() { + *x = SQL_ConnectionPools{} + if protoimpl.UnsafeEnabled { + mi := &file_storage_sql_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SQL_ConnectionPools) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SQL_ConnectionPools) ProtoMessage() {} + +func (x *SQL_ConnectionPools) ProtoReflect() protoreflect.Message { + mi := &file_storage_sql_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 SQL_ConnectionPools.ProtoReflect.Descriptor instead. +func (*SQL_ConnectionPools) Descriptor() ([]byte, []int) { + return file_storage_sql_proto_rawDescGZIP(), []int{0, 0} +} + +func (x *SQL_ConnectionPools) GetDefault() *SQL_ConnectionPool { + if x != nil { + return x.Default + } + return nil +} + +// ConnectionPool confifugration for the SQL server +type SQL_ConnectionPool struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Database username + User string `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"` + // Database password + Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"` + // Database connection string. This needs to include server port + // and database name as well + JdbcUrl string `protobuf:"bytes,3,opt,name=jdbcUrl,proto3" json:"jdbcUrl,omitempty"` + // Database connection timeout + ConnectionTimeout int32 `protobuf:"varint,4,opt,name=connectionTimeout,proto3" json:"connectionTimeout,omitempty"` + // maxLifetime controls the maximum lifetime of a connection in the pool. + MaxLifetime int32 `protobuf:"varint,5,opt,name=maxLifetime,proto3" json:"maxLifetime,omitempty"` + // Maximum number of connections stored in the connection pool + MaxPoolSize int32 `protobuf:"varint,6,opt,name=maxPoolSize,proto3" json:"maxPoolSize,omitempty"` +} + +func (x *SQL_ConnectionPool) Reset() { + *x = SQL_ConnectionPool{} + if protoimpl.UnsafeEnabled { + mi := &file_storage_sql_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SQL_ConnectionPool) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SQL_ConnectionPool) ProtoMessage() {} + +func (x *SQL_ConnectionPool) ProtoReflect() protoreflect.Message { + mi := &file_storage_sql_proto_msgTypes[2] + 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 SQL_ConnectionPool.ProtoReflect.Descriptor instead. +func (*SQL_ConnectionPool) Descriptor() ([]byte, []int) { + return file_storage_sql_proto_rawDescGZIP(), []int{0, 1} +} + +func (x *SQL_ConnectionPool) GetUser() string { + if x != nil { + return x.User + } + return "" +} + +func (x *SQL_ConnectionPool) GetPassword() string { + if x != nil { + return x.Password + } + return "" +} + +func (x *SQL_ConnectionPool) GetJdbcUrl() string { + if x != nil { + return x.JdbcUrl + } + return "" +} + +func (x *SQL_ConnectionPool) GetConnectionTimeout() int32 { + if x != nil { + return x.ConnectionTimeout + } + return 0 +} + +func (x *SQL_ConnectionPool) GetMaxLifetime() int32 { + if x != nil { + return x.MaxLifetime + } + return 0 +} + +func (x *SQL_ConnectionPool) GetMaxPoolSize() int32 { + if x != nil { + return x.MaxPoolSize + } + return 0 +} + +var File_storage_sql_proto protoreflect.FileDescriptor + +var file_storage_sql_proto_rawDesc = []byte{ + 0x0a, 0x11, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2f, 0x73, 0x71, 0x6c, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x12, 0x0d, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, + 0x67, 0x65, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2f, 0x77, 0x72, 0x61, 0x70, 0x70, 0x65, 0x72, 0x73, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x22, 0xe9, 0x03, 0x0a, 0x03, 0x53, 0x51, 0x4c, 0x12, 0x34, 0x0a, 0x07, 0x65, 0x6e, + 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x42, 0x6f, + 0x6f, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, + 0x12, 0x4c, 0x0a, 0x0f, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x6f, + 0x6f, 0x6c, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x53, 0x51, 0x4c, 0x2e, 0x43, 0x6f, + 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x6f, 0x6f, 0x6c, 0x73, 0x52, 0x0f, 0x63, + 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x6f, 0x6f, 0x6c, 0x73, 0x12, 0x3f, + 0x0a, 0x09, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x21, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, + 0x65, 0x2e, 0x53, 0x51, 0x4c, 0x2e, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, + 0x50, 0x6f, 0x6f, 0x6c, 0x52, 0x09, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x1a, + 0x4e, 0x0a, 0x0f, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x6f, 0x6f, + 0x6c, 0x73, 0x12, 0x3b, 0x0a, 0x07, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x73, 0x74, 0x6f, 0x72, + 0x61, 0x67, 0x65, 0x2e, 0x53, 0x51, 0x4c, 0x2e, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, + 0x6f, 0x6e, 0x50, 0x6f, 0x6f, 0x6c, 0x52, 0x07, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x1a, + 0xcc, 0x01, 0x0a, 0x0e, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x6f, + 0x6f, 0x6c, 0x12, 0x12, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 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, 0x12, 0x18, 0x0a, 0x07, 0x6a, 0x64, 0x62, 0x63, 0x55, 0x72, 0x6c, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x07, 0x6a, 0x64, 0x62, 0x63, 0x55, 0x72, 0x6c, 0x12, 0x2c, 0x0a, 0x11, + 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, + 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x11, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x12, 0x20, 0x0a, 0x0b, 0x6d, 0x61, + 0x78, 0x4c, 0x69, 0x66, 0x65, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x0b, 0x6d, 0x61, 0x78, 0x4c, 0x69, 0x66, 0x65, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, + 0x6d, 0x61, 0x78, 0x50, 0x6f, 0x6f, 0x6c, 0x53, 0x69, 0x7a, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x0b, 0x6d, 0x61, 0x78, 0x50, 0x6f, 0x6f, 0x6c, 0x53, 0x69, 0x7a, 0x65, 0x42, 0x2f, + 0x5a, 0x2d, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x73, 0x70, 0x69, + 0x6e, 0x6e, 0x61, 0x6b, 0x65, 0x72, 0x2f, 0x6b, 0x6c, 0x65, 0x61, 0x74, 0x2f, 0x61, 0x70, 0x69, + 0x2f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x2f, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x62, + 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_storage_sql_proto_rawDescOnce sync.Once + file_storage_sql_proto_rawDescData = file_storage_sql_proto_rawDesc +) + +func file_storage_sql_proto_rawDescGZIP() []byte { + file_storage_sql_proto_rawDescOnce.Do(func() { + file_storage_sql_proto_rawDescData = protoimpl.X.CompressGZIP(file_storage_sql_proto_rawDescData) + }) + return file_storage_sql_proto_rawDescData +} + +var file_storage_sql_proto_msgTypes = make([]protoimpl.MessageInfo, 3) +var file_storage_sql_proto_goTypes = []interface{}{ + (*SQL)(nil), // 0: proto.storage.SQL + (*SQL_ConnectionPools)(nil), // 1: proto.storage.SQL.ConnectionPools + (*SQL_ConnectionPool)(nil), // 2: proto.storage.SQL.ConnectionPool + (*wrappers.BoolValue)(nil), // 3: google.protobuf.BoolValue +} +var file_storage_sql_proto_depIdxs = []int32{ + 3, // 0: proto.storage.SQL.enabled:type_name -> google.protobuf.BoolValue + 1, // 1: proto.storage.SQL.connectionPools:type_name -> proto.storage.SQL.ConnectionPools + 2, // 2: proto.storage.SQL.migration:type_name -> proto.storage.SQL.ConnectionPool + 2, // 3: proto.storage.SQL.ConnectionPools.default:type_name -> proto.storage.SQL.ConnectionPool + 4, // [4:4] is the sub-list for method output_type + 4, // [4:4] is the sub-list for method input_type + 4, // [4:4] is the sub-list for extension type_name + 4, // [4:4] is the sub-list for extension extendee + 0, // [0:4] is the sub-list for field type_name +} + +func init() { file_storage_sql_proto_init() } +func file_storage_sql_proto_init() { + if File_storage_sql_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_storage_sql_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SQL); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_storage_sql_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SQL_ConnectionPools); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_storage_sql_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SQL_ConnectionPool); 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_storage_sql_proto_rawDesc, + NumEnums: 0, + NumMessages: 3, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_storage_sql_proto_goTypes, + DependencyIndexes: file_storage_sql_proto_depIdxs, + MessageInfos: file_storage_sql_proto_msgTypes, + }.Build() + File_storage_sql_proto = out.File + file_storage_sql_proto_rawDesc = nil + file_storage_sql_proto_goTypes = nil + file_storage_sql_proto_depIdxs = nil +} diff --git a/api/proto/storage/redis.proto b/api/proto/storage/redis.proto new file mode 100644 index 00000000..0db6502f --- /dev/null +++ b/api/proto/storage/redis.proto @@ -0,0 +1,17 @@ +syntax = "proto3"; +package proto.storage; + +option go_package = "github.com/spinnaker/kleat/api/client/storage"; + +import "google/protobuf/wrappers.proto"; + +message Redis { + // Whether this persistent store is enabled. + google.protobuf.BoolValue enabled = 1; + + // The host for the redis server + string host = 2; + + // The port for the redis server + int32 port = 3; +} diff --git a/api/proto/storage/sql.proto b/api/proto/storage/sql.proto new file mode 100644 index 00000000..284bc917 --- /dev/null +++ b/api/proto/storage/sql.proto @@ -0,0 +1,40 @@ +syntax = "proto3"; +package proto.storage; + +option go_package = "github.com/spinnaker/kleat/api/client/storage"; + +import "google/protobuf/wrappers.proto"; + +message SQL { + // Whether this persistent store is enabled. + google.protobuf.BoolValue enabled = 1; + + // Default database connection pool. + ConnectionPools connectionPools = 2; + + // Migration connection pool + ConnectionPool migration = 3; + + // The default connection pool + message ConnectionPools { + ConnectionPool default = 1; + } + + // ConnectionPool confifugration for the SQL server + message ConnectionPool { + // Database username + string user = 1; + // Database password + string password = 2; + // Database connection string. This needs to include server port + // and database name as well + string jdbcUrl = 3; + // Database connection timeout + int32 connectionTimeout = 4; + // maxLifetime controls the maximum lifetime of a connection in the pool. + int32 maxLifetime = 5; + // Maximum number of connections stored in the connection pool + int32 maxPoolSize = 6; + } +} + diff --git a/docs/docs.md b/docs/docs.md index c1fbabb3..a03104b4 100644 --- a/docs/docs.md +++ b/docs/docs.md @@ -419,11 +419,19 @@ - [storage/persistent_storage.proto](#storage/persistent_storage.proto) - [PersistentStorage](#proto.storage.PersistentStorage) +- [storage/redis.proto](#storage/redis.proto) + - [Redis](#proto.storage.Redis) + - [storage/s3.proto](#storage/s3.proto) - [S3](#proto.storage.S3) - [S3ServerSideEncryption](#proto.storage.S3ServerSideEncryption) +- [storage/sql.proto](#storage/sql.proto) + - [SQL](#proto.storage.SQL) + - [SQL.ConnectionPool](#proto.storage.SQL.ConnectionPool) + - [SQL.ConnectionPools](#proto.storage.SQL.ConnectionPools) + - [Scalar Value Types](#scalar-value-types) @@ -6135,6 +6143,39 @@ Configuration of Spinnaker's persistent storage. + +

Top

+ +## storage/redis.proto + + + + + +### Redis + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| enabled | [google.protobuf.BoolValue](#google.protobuf.BoolValue) | | Whether this persistent store is enabled. | +| host | [string](#string) | | The host for the redis server | +| port | [int32](#int32) | | The port for the redis server | + + + + + + + + + + + + + + +

Top

@@ -6188,6 +6229,74 @@ the 'x-amz-server-side-encryption' header. + +

Top

+ +## storage/sql.proto + + + + + +### SQL + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| enabled | [google.protobuf.BoolValue](#google.protobuf.BoolValue) | | Whether this persistent store is enabled. | +| connectionPools | [SQL.ConnectionPools](#proto.storage.SQL.ConnectionPools) | | Default database connection pool. | +| migration | [SQL.ConnectionPool](#proto.storage.SQL.ConnectionPool) | | Migration connection pool | + + + + + + + + +### SQL.ConnectionPool +ConnectionPool confifugration for the SQL server + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| user | [string](#string) | | Database username | +| password | [string](#string) | | Database password | +| jdbcUrl | [string](#string) | | Database connection string. This needs to include server port and database name as well | +| connectionTimeout | [int32](#int32) | | Database connection timeout | +| maxLifetime | [int32](#int32) | | maxLifetime controls the maximum lifetime of a connection in the pool. | +| maxPoolSize | [int32](#int32) | | Maximum number of connections stored in the connection pool | + + + + + + + + +### SQL.ConnectionPools +The default connection pool + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| default | [SQL.ConnectionPool](#proto.storage.SQL.ConnectionPool) | | | + + + + + + + + + + + + + + + ## Scalar Value Types | .proto Type | Notes | C++ | Java | Python | Go | C# | PHP | Ruby |