Documentation ¶
Index ¶
- func InitCORS(cfg *CORSConfig) cors.Config
- func InitDB(cfg *DBConfig, sqlFSs ...fs.FS) (libgateway.DialectRDBMS, *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 PostgresConfig
- 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 InitDB ¶
func InitDB(cfg *DBConfig, sqlFSs ...fs.FS) (libgateway.DialectRDBMS, *gorm.DB, *sql.DB, error)
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"` Postgres *PostgresConfig `yaml:"postgres"` Migration bool `yaml:"migration"` }
type MySQLConfig ¶
type OTLPConfig ¶
type PostgresConfig ¶ added in v0.0.8
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.