config

package
v0.0.0-...-4f3fcd8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 15, 2025 License: MIT Imports: 19 Imported by: 10

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitCORS

func InitCORS(cfg *CORSConfig) cors.Config

func InitDB

func InitDB(ctx context.Context, cfg *DBConfig, sqlFSs ...fs.FS) (libgateway.DialectRDBMS, *gorm.DB, *sql.DB, error)

func InitLog

func InitLog(cfg *LogConfig)

func InitTracerProvider

func InitTracerProvider(ctx context.Context, appName string, traceConfig *TraceConfig) (*sdktrace.TracerProvider, error)

func MergeFS

func MergeFS(driverName string, fss ...fs.FS) (*mergedFS, error)

Types

type CORSConfig

type CORSConfig struct {
	AllowOrigins []string `yaml:"allowOrigins"`
}

type DBConfig

type DBConfig struct {
	DriverName string                     `yaml:"driverName"`
	MySQL      *libgateway.MySQLConfig    `yaml:"mysql"`
	Postgres   *libgateway.PostgresConfig `yaml:"postgres"`
	SQLite3    *libgateway.SQLite3Config  `yaml:"sqlite3"`
	Migration  bool                       `yaml:"migration"`
}

type GoogleTraceConfig

type GoogleTraceConfig struct {
	ProjectID string `yaml:"projectID" validate:"required"`
}

type InitDBFunc

type InitDBFunc func(context.Context, *DBConfig, fs.FS) (libgateway.DialectRDBMS, *gorm.DB, *sql.DB, error)

type InitTracerExporterFunc

type InitTracerExporterFunc func(ctx context.Context, traceConfig *TraceConfig) (sdktrace.SpanExporter, error)

type LogConfig

type LogConfig struct {
	Level string `yaml:"level"`
}

type OTLPConfig

type OTLPConfig struct {
	Endpoint string `yaml:"endpoint" validate:"required"`
	Insecure bool   `yaml:"insecure"`
}

type SwaggerConfig

type SwaggerConfig struct {
	Enabled bool   `yaml:"enabled"`
	Host    string `yaml:"host"`
	Schema  string `yaml:"schema"`
}

type TraceConfig

type TraceConfig struct {
	Exporter string             `yaml:"exporter" validate:"required"`
	OTLP     *OTLPConfig        `yaml:"otlp"`
	Google   *GoogleTraceConfig `yaml:"google"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL