向宁 ed47904a85 chore: initialize Kratos project skeleton, add proto config and Makefile
- Add Makefile with api/config/wire/build/run/test/clean targets
- Update buf.yaml with api, internal/conf, and third_party modules
- Update buf.gen.yaml with protobuf, grpc, and grpc-gateway plugins
- Add internal/conf/conf.proto (Kratos config schema: Bootstrap/Server/Data/Auth)
- Generate internal/conf/conf.pb.go via buf
- Add configs/config.yaml with HTTP/gRPC server, Postgres, S3, and auth settings
- Add third_party/google/api proto files (annotations, http)
- Remove old Gin-based layers: internal/api, internal/infrastructure/mediator,
  internal/middleware, internal/common, docs
- Update .gitignore to exclude server binary and bin/
2026-05-25 12:37:45 +08:00

567 lines
15 KiB
Go

// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.11
// protoc (unknown)
// source: conf.proto
package conf
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
durationpb "google.golang.org/protobuf/types/known/durationpb"
reflect "reflect"
sync "sync"
unsafe "unsafe"
)
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 Bootstrap struct {
state protoimpl.MessageState `protogen:"open.v1"`
Server *Server `protobuf:"bytes,1,opt,name=server,proto3" json:"server,omitempty"`
Data *Data `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"`
Auth *Auth `protobuf:"bytes,3,opt,name=auth,proto3" json:"auth,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *Bootstrap) Reset() {
*x = Bootstrap{}
mi := &file_conf_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *Bootstrap) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Bootstrap) ProtoMessage() {}
func (x *Bootstrap) ProtoReflect() protoreflect.Message {
mi := &file_conf_proto_msgTypes[0]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use Bootstrap.ProtoReflect.Descriptor instead.
func (*Bootstrap) Descriptor() ([]byte, []int) {
return file_conf_proto_rawDescGZIP(), []int{0}
}
func (x *Bootstrap) GetServer() *Server {
if x != nil {
return x.Server
}
return nil
}
func (x *Bootstrap) GetData() *Data {
if x != nil {
return x.Data
}
return nil
}
func (x *Bootstrap) GetAuth() *Auth {
if x != nil {
return x.Auth
}
return nil
}
type Server struct {
state protoimpl.MessageState `protogen:"open.v1"`
Http *Server_HTTP `protobuf:"bytes,1,opt,name=http,proto3" json:"http,omitempty"`
Grpc *Server_GRPC `protobuf:"bytes,2,opt,name=grpc,proto3" json:"grpc,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *Server) Reset() {
*x = Server{}
mi := &file_conf_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *Server) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Server) ProtoMessage() {}
func (x *Server) ProtoReflect() protoreflect.Message {
mi := &file_conf_proto_msgTypes[1]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use Server.ProtoReflect.Descriptor instead.
func (*Server) Descriptor() ([]byte, []int) {
return file_conf_proto_rawDescGZIP(), []int{1}
}
func (x *Server) GetHttp() *Server_HTTP {
if x != nil {
return x.Http
}
return nil
}
func (x *Server) GetGrpc() *Server_GRPC {
if x != nil {
return x.Grpc
}
return nil
}
type Data struct {
state protoimpl.MessageState `protogen:"open.v1"`
Database *Data_Database `protobuf:"bytes,1,opt,name=database,proto3" json:"database,omitempty"`
S3 *Data_S3 `protobuf:"bytes,2,opt,name=s3,proto3" json:"s3,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *Data) Reset() {
*x = Data{}
mi := &file_conf_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *Data) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Data) ProtoMessage() {}
func (x *Data) ProtoReflect() protoreflect.Message {
mi := &file_conf_proto_msgTypes[2]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use Data.ProtoReflect.Descriptor instead.
func (*Data) Descriptor() ([]byte, []int) {
return file_conf_proto_rawDescGZIP(), []int{2}
}
func (x *Data) GetDatabase() *Data_Database {
if x != nil {
return x.Database
}
return nil
}
func (x *Data) GetS3() *Data_S3 {
if x != nil {
return x.S3
}
return nil
}
type Auth struct {
state protoimpl.MessageState `protogen:"open.v1"`
JwtKey string `protobuf:"bytes,1,opt,name=jwt_key,json=jwtKey,proto3" json:"jwt_key,omitempty"`
GrpcAddr string `protobuf:"bytes,2,opt,name=grpc_addr,json=grpcAddr,proto3" json:"grpc_addr,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *Auth) Reset() {
*x = Auth{}
mi := &file_conf_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *Auth) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Auth) ProtoMessage() {}
func (x *Auth) ProtoReflect() protoreflect.Message {
mi := &file_conf_proto_msgTypes[3]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use Auth.ProtoReflect.Descriptor instead.
func (*Auth) Descriptor() ([]byte, []int) {
return file_conf_proto_rawDescGZIP(), []int{3}
}
func (x *Auth) GetJwtKey() string {
if x != nil {
return x.JwtKey
}
return ""
}
func (x *Auth) GetGrpcAddr() string {
if x != nil {
return x.GrpcAddr
}
return ""
}
type Server_HTTP struct {
state protoimpl.MessageState `protogen:"open.v1"`
Addr string `protobuf:"bytes,1,opt,name=addr,proto3" json:"addr,omitempty"`
Timeout *durationpb.Duration `protobuf:"bytes,2,opt,name=timeout,proto3" json:"timeout,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *Server_HTTP) Reset() {
*x = Server_HTTP{}
mi := &file_conf_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *Server_HTTP) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Server_HTTP) ProtoMessage() {}
func (x *Server_HTTP) ProtoReflect() protoreflect.Message {
mi := &file_conf_proto_msgTypes[4]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use Server_HTTP.ProtoReflect.Descriptor instead.
func (*Server_HTTP) Descriptor() ([]byte, []int) {
return file_conf_proto_rawDescGZIP(), []int{1, 0}
}
func (x *Server_HTTP) GetAddr() string {
if x != nil {
return x.Addr
}
return ""
}
func (x *Server_HTTP) GetTimeout() *durationpb.Duration {
if x != nil {
return x.Timeout
}
return nil
}
type Server_GRPC struct {
state protoimpl.MessageState `protogen:"open.v1"`
Addr string `protobuf:"bytes,1,opt,name=addr,proto3" json:"addr,omitempty"`
Timeout *durationpb.Duration `protobuf:"bytes,2,opt,name=timeout,proto3" json:"timeout,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *Server_GRPC) Reset() {
*x = Server_GRPC{}
mi := &file_conf_proto_msgTypes[5]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *Server_GRPC) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Server_GRPC) ProtoMessage() {}
func (x *Server_GRPC) ProtoReflect() protoreflect.Message {
mi := &file_conf_proto_msgTypes[5]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use Server_GRPC.ProtoReflect.Descriptor instead.
func (*Server_GRPC) Descriptor() ([]byte, []int) {
return file_conf_proto_rawDescGZIP(), []int{1, 1}
}
func (x *Server_GRPC) GetAddr() string {
if x != nil {
return x.Addr
}
return ""
}
func (x *Server_GRPC) GetTimeout() *durationpb.Duration {
if x != nil {
return x.Timeout
}
return nil
}
type Data_Database struct {
state protoimpl.MessageState `protogen:"open.v1"`
Driver string `protobuf:"bytes,1,opt,name=driver,proto3" json:"driver,omitempty"`
Source string `protobuf:"bytes,2,opt,name=source,proto3" json:"source,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *Data_Database) Reset() {
*x = Data_Database{}
mi := &file_conf_proto_msgTypes[6]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *Data_Database) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Data_Database) ProtoMessage() {}
func (x *Data_Database) ProtoReflect() protoreflect.Message {
mi := &file_conf_proto_msgTypes[6]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use Data_Database.ProtoReflect.Descriptor instead.
func (*Data_Database) Descriptor() ([]byte, []int) {
return file_conf_proto_rawDescGZIP(), []int{2, 0}
}
func (x *Data_Database) GetDriver() string {
if x != nil {
return x.Driver
}
return ""
}
func (x *Data_Database) GetSource() string {
if x != nil {
return x.Source
}
return ""
}
type Data_S3 struct {
state protoimpl.MessageState `protogen:"open.v1"`
Endpoint string `protobuf:"bytes,1,opt,name=endpoint,proto3" json:"endpoint,omitempty"`
AccessKey string `protobuf:"bytes,2,opt,name=access_key,json=accessKey,proto3" json:"access_key,omitempty"`
SecretKey string `protobuf:"bytes,3,opt,name=secret_key,json=secretKey,proto3" json:"secret_key,omitempty"`
Region string `protobuf:"bytes,4,opt,name=region,proto3" json:"region,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *Data_S3) Reset() {
*x = Data_S3{}
mi := &file_conf_proto_msgTypes[7]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *Data_S3) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Data_S3) ProtoMessage() {}
func (x *Data_S3) ProtoReflect() protoreflect.Message {
mi := &file_conf_proto_msgTypes[7]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use Data_S3.ProtoReflect.Descriptor instead.
func (*Data_S3) Descriptor() ([]byte, []int) {
return file_conf_proto_rawDescGZIP(), []int{2, 1}
}
func (x *Data_S3) GetEndpoint() string {
if x != nil {
return x.Endpoint
}
return ""
}
func (x *Data_S3) GetAccessKey() string {
if x != nil {
return x.AccessKey
}
return ""
}
func (x *Data_S3) GetSecretKey() string {
if x != nil {
return x.SecretKey
}
return ""
}
func (x *Data_S3) GetRegion() string {
if x != nil {
return x.Region
}
return ""
}
var File_conf_proto protoreflect.FileDescriptor
const file_conf_proto_rawDesc = "" +
"\n" +
"\n" +
"conf.proto\x12\x04conf\x1a\x1egoogle/protobuf/duration.proto\"q\n" +
"\tBootstrap\x12$\n" +
"\x06server\x18\x01 \x01(\v2\f.conf.ServerR\x06server\x12\x1e\n" +
"\x04data\x18\x02 \x01(\v2\n" +
".conf.DataR\x04data\x12\x1e\n" +
"\x04auth\x18\x03 \x01(\v2\n" +
".conf.AuthR\x04auth\"\xf8\x01\n" +
"\x06Server\x12%\n" +
"\x04http\x18\x01 \x01(\v2\x11.conf.Server.HTTPR\x04http\x12%\n" +
"\x04grpc\x18\x02 \x01(\v2\x11.conf.Server.GRPCR\x04grpc\x1aO\n" +
"\x04HTTP\x12\x12\n" +
"\x04addr\x18\x01 \x01(\tR\x04addr\x123\n" +
"\atimeout\x18\x02 \x01(\v2\x19.google.protobuf.DurationR\atimeout\x1aO\n" +
"\x04GRPC\x12\x12\n" +
"\x04addr\x18\x01 \x01(\tR\x04addr\x123\n" +
"\atimeout\x18\x02 \x01(\v2\x19.google.protobuf.DurationR\atimeout\"\x8a\x02\n" +
"\x04Data\x12/\n" +
"\bdatabase\x18\x01 \x01(\v2\x13.conf.Data.DatabaseR\bdatabase\x12\x1d\n" +
"\x02s3\x18\x02 \x01(\v2\r.conf.Data.S3R\x02s3\x1a:\n" +
"\bDatabase\x12\x16\n" +
"\x06driver\x18\x01 \x01(\tR\x06driver\x12\x16\n" +
"\x06source\x18\x02 \x01(\tR\x06source\x1av\n" +
"\x02S3\x12\x1a\n" +
"\bendpoint\x18\x01 \x01(\tR\bendpoint\x12\x1d\n" +
"\n" +
"access_key\x18\x02 \x01(\tR\taccessKey\x12\x1d\n" +
"\n" +
"secret_key\x18\x03 \x01(\tR\tsecretKey\x12\x16\n" +
"\x06region\x18\x04 \x01(\tR\x06region\"<\n" +
"\x04Auth\x12\x17\n" +
"\ajwt_key\x18\x01 \x01(\tR\x06jwtKey\x12\x1b\n" +
"\tgrpc_addr\x18\x02 \x01(\tR\bgrpcAddrB\x1fZ\x1drag/file-system/internal/confb\x06proto3"
var (
file_conf_proto_rawDescOnce sync.Once
file_conf_proto_rawDescData []byte
)
func file_conf_proto_rawDescGZIP() []byte {
file_conf_proto_rawDescOnce.Do(func() {
file_conf_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_conf_proto_rawDesc), len(file_conf_proto_rawDesc)))
})
return file_conf_proto_rawDescData
}
var file_conf_proto_msgTypes = make([]protoimpl.MessageInfo, 8)
var file_conf_proto_goTypes = []any{
(*Bootstrap)(nil), // 0: conf.Bootstrap
(*Server)(nil), // 1: conf.Server
(*Data)(nil), // 2: conf.Data
(*Auth)(nil), // 3: conf.Auth
(*Server_HTTP)(nil), // 4: conf.Server.HTTP
(*Server_GRPC)(nil), // 5: conf.Server.GRPC
(*Data_Database)(nil), // 6: conf.Data.Database
(*Data_S3)(nil), // 7: conf.Data.S3
(*durationpb.Duration)(nil), // 8: google.protobuf.Duration
}
var file_conf_proto_depIdxs = []int32{
1, // 0: conf.Bootstrap.server:type_name -> conf.Server
2, // 1: conf.Bootstrap.data:type_name -> conf.Data
3, // 2: conf.Bootstrap.auth:type_name -> conf.Auth
4, // 3: conf.Server.http:type_name -> conf.Server.HTTP
5, // 4: conf.Server.grpc:type_name -> conf.Server.GRPC
6, // 5: conf.Data.database:type_name -> conf.Data.Database
7, // 6: conf.Data.s3:type_name -> conf.Data.S3
8, // 7: conf.Server.HTTP.timeout:type_name -> google.protobuf.Duration
8, // 8: conf.Server.GRPC.timeout:type_name -> google.protobuf.Duration
9, // [9:9] is the sub-list for method output_type
9, // [9:9] is the sub-list for method input_type
9, // [9:9] is the sub-list for extension type_name
9, // [9:9] is the sub-list for extension extendee
0, // [0:9] is the sub-list for field type_name
}
func init() { file_conf_proto_init() }
func file_conf_proto_init() {
if File_conf_proto != nil {
return
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: unsafe.Slice(unsafe.StringData(file_conf_proto_rawDesc), len(file_conf_proto_rawDesc)),
NumEnums: 0,
NumMessages: 8,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_conf_proto_goTypes,
DependencyIndexes: file_conf_proto_depIdxs,
MessageInfos: file_conf_proto_msgTypes,
}.Build()
File_conf_proto = out.File
file_conf_proto_goTypes = nil
file_conf_proto_depIdxs = nil
}