Versions in this module Expand all Collapse all v0 v0.0.2 Dec 9, 2021 v0.0.1 Oct 19, 2021 Changes in this version + var AccessLogger log4go.Logger + var BFEProductID int64 = 1 + var DBs map[string]*sql.DB + var IgnoreBNSStatusCheck bool + var MetricAPIAccessCounter = prometheus.NewCounterVec(prometheus.CounterOpts{ ... }, []string{ ... }) + var MetricAPICostHisCounter = prometheus.NewCounterVec(prometheus.CounterOpts{ ... }, []string{ ... }) + var MetricPaincCounter = prometheus.NewCounter(prometheus.CounterOpts{ ... }) + var MetricSQLAccessCounter = prometheus.NewCounterVec(prometheus.CounterOpts{ ... }, []string{ ... }) + var MetricSQLCostCounter = prometheus.NewCounterVec(prometheus.CounterOpts{ ... }, []string{ ... }) + var SQLLogger log4go.Logger + func BFEDB(db ...*sql.DB) (*sql.DB, error) + func CloseLog() + func DbGet(name string) (*sql.DB, error) + func Exit(topic string, err error, code int) + func InitI18n(i18nConfig []*I18nConfig) error + func LoadConfig(file string) error + func NewBFEDBContext(ctx context.Context, ops ...*lib.Op) (*lib.DBContext, error) + func NewDB(dbConfig *DbConfig) (*sql.DB, error) + func NewMonitorServerWithRun(version string, port int) *web_monitor.MonitorServer + func TryMappingErrMsg(req *http.Request, errMsg string) string + type Config struct + ConfigDir string + Databases map[string]*DbConfig + Depends DependsConfig + LogDir string + Loggers map[string]*LoggerConfig + RunTime RunTimeConfig + Server ServerConfig + Vars map[string]string + var DefaultConfig *Config + func (config *Config) Init() error + func (config *Config) InitLog() error + func (d *Config) InitDB() error + type DbConfig struct + ConnMaxIdleTimeMs int + ConnMaxLifetimeMs int + Driver string + MaxIdleConns int + MaxOpenConns int + type DependsConfig struct + I18nDir string + NavTreeFile string + UIIcon string + UILogo string + func (d *DependsConfig) Init() error + func (dc *DependsConfig) Role2Nav() map[string]*NavTree + type I18nConfig struct + Lang string + Mapping map[string]string + type LangMapping struct + From string + To string + func NewLangMapping(from, to string) (*LangMapping, error) + func (mm *LangMapping) TryTrans(raw string) (string, bool) + type LoggerConfig struct + BackupCount int + Format string + LogLevel string + LogName string + RotateWhen string + StdOut bool + type NavTree struct + AllowRoles []string + Children []*NavTree + ID string + Text string + type RunTimeConfig struct + Debug bool + RecordSQL bool + SessionExpireDay int + SkipTokenValidate bool + StaticFilePath string + type SQLRecord struct + Args []interface{} + Cost time.Duration + Err error + SQL string + func (sr *SQLRecord) Print(ctx context.Context) + func (sr *SQLRecord) String(ctx context.Context) string + func (sr *SQLRecord) UpdateMonitor() + type ServerConfig struct + GracefulTimeOutMs int + MonitorPort int + ServerPort int