Documentation
¶
Index ¶
- func InitCORS(cfg *CORSConfig) cors.Config
- func InitDB(cfg *DBConfig, sqlFS embed.FS) (*gorm.DB, *sql.DB, error)
- func InitLog(cfg *LogConfig) error
- func InitTracerProvider(ctx context.Context, appName string, traceConfig *TraceConfig) (*sdktrace.TracerProvider, error)
- type CORSConfig
- type DBConfig
- type LogConfig
- type MySQLConfig
- type OTLPConfig
- type SQLite3Config
- type SwaggerConfig
- type TraceConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitCORS ¶
func InitCORS(cfg *CORSConfig) cors.Config
func InitTracerProvider ¶
func InitTracerProvider(ctx context.Context, appName string, traceConfig *TraceConfig) (*sdktrace.TracerProvider, error)
Types ¶
type CORSConfig ¶
type CORSConfig struct {
AllowOrigins []string `yaml:"allowOrigins"`
}
type DBConfig ¶
type DBConfig struct {
DriverName string `yaml:"driverName"`
SQLite3 *SQLite3Config `yaml:"sqlite3"`
MySQL *MySQLConfig `yaml:"mysql"`
Migration bool `yaml:"migration"`
}
type MySQLConfig ¶
type OTLPConfig ¶
type SQLite3Config ¶
type SQLite3Config struct {
File string `yaml:"file" validate:"required"`
}
type SwaggerConfig ¶
type TraceConfig ¶
type TraceConfig struct {
Exporter string `yaml:"exporter" validate:"required"`
OTLP *OTLPConfig `yaml:"otlp"`
}
Click to show internal directories.
Click to hide internal directories.