Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AppConfig ¶
type AppConfig struct { Port string `yaml:"port"` Fast any `yaml:"fast"` Methods string `yaml:"methods"` FastGroup string `yaml:"fastGroup" yaml:"fast_group"` ServerName string `yaml:"serverName" yaml:"server_name"` Routes []RouteConfig `yaml:"routes"` Datasource DatasourceConfig `yaml:"datasource"` DisableSnowflakeId bool `yaml:"disableSnowflakeId" yaml:"disable_snowflake_id"` DisableMapper bool `yaml:"disableMapper" yaml:"disable_mapper"` FieldCase string `yaml:"fieldCase" yaml:"field_case"` UploadRootPath string `yaml:"uploadRootPath" yaml:"upload_root_path"` LoginTimeout time.Duration `yaml:"loginTimeout" yaml:"login_timeout"` UserSigningKey string `yaml:"userSigningKey" yaml:"user_signing_key"` AdminSigningKey string `yaml:"adminSigningKey" yaml:"admin_signing_key"` }
var (
Config *AppConfig
)
type DatasourceConfig ¶
type DatasourceConfig struct { Config GOrmConfig `yaml:"Config"` Pools PoolsConfig `yaml:"pools"` Connections map[string]DBConfig `yaml:"connections"` Prometheus prometheus.Config `yaml:"prometheus"` }
type GOrmConfig ¶
type GOrmConfig struct { // GORM perform single create, update, delete operations in transactions by default to ensure database data integrity // You can disable it by setting `SkipDefaultTransaction` to true SkipDefaultTransaction bool `yaml:"skipDefaultTransaction"` // NamingStrategy tables, columns naming strategy NamingStrategy schema.Namer `yaml:"namingStrategy"` // FullSaveAssociations full save associations FullSaveAssociations bool `yaml:"fullSaveAssociations,omitempty"` // Logger Logger logger.Interface `yaml:"logger,omitempty"` // NowFunc the function to be used when creating a new timestamp NowFunc func() time.Time `yaml:"nowFunc"` // DryRun generate sql without execute DryRun bool `yaml:"dryRun"` // PrepareStmt executes the given query in cached statement PrepareStmt bool `yaml:"prepareStmt"` // DisableAutomaticPing DisableAutomaticPing bool `yaml:"disableAutomaticPing"` // DisableForeignKeyConstraintWhenMigrating DisableForeignKeyConstraintWhenMigrating bool `yaml:"disableForeignKeyConstraintWhenMigrating"` // IgnoreRelationshipsWhenMigrating IgnoreRelationshipsWhenMigrating bool `yaml:"ignoreRelationshipsWhenMigrating"` // DisableNestedTransaction disable nested transaction DisableNestedTransaction bool `yaml:"disableNestedTransaction"` // AllowGlobalUpdate allow global update AllowGlobalUpdate bool `yaml:"allowGlobalUpdate"` // QueryFields executes the SQL query with all fields of the table QueryFields bool `yaml:"queryFields"` // CreateBatchSize default create batch size CreateBatchSize int `yaml:"createBatchSize"` // TranslateError enabling error translation TranslateError bool `yaml:"translateError"` // PropagateUnscoped propagate Unscoped to every other nested statement PropagateUnscoped bool `yaml:"propagateUnscoped"` // ClauseBuilders clause builder ClauseBuilders map[string]clause.ClauseBuilder `yaml:"clauseBuilders"` CacheStore *sync.Map `yaml:"cacheStore"` }
Config GORM Config
func (GOrmConfig) AfterInitialize ¶
func (G GOrmConfig) AfterInitialize(db *gorm.DB) error
type PoolsConfig ¶
type RouteConfig ¶
Click to show internal directories.
Click to hide internal directories.