config

package
v0.0.0-...-04b3042 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2023 License: MIT Imports: 17 Imported by: 8

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(cfg *DBConfig, sqlFS embed.FS) (*gorm.DB, *sql.DB, error)

func InitLog

func InitLog(env string, cfg *LogConfig) error

func InitTracerProvider

func InitTracerProvider(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"`
}

type JaegerConfig

type JaegerConfig struct {
	Endpoint string `yaml:"endpoint" validate:"required"`
}

type LogConfig

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

type MySQLConfig

type MySQLConfig struct {
	Username string `yaml:"username" validate:"required"`
	Password string `yaml:"password" validate:"required"`
	Host     string `yaml:"host" validate:"required"`
	Port     int    `yaml:"port" validate:"required"`
	Database string `yaml:"database" validate:"required"`
}

type SQLite3Config

type SQLite3Config struct {
	File string `yaml:"file" validate:"required"`
}

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"`
	Jaeger   *JaegerConfig `yaml:"jaeger"`
}

Jump to

Keyboard shortcuts

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