Versions in this module Expand all Collapse all v1 v1.0.0 May 31, 2023 Changes in this version + const MongoDefaultConnectTimeout + const MongoDefaultDatabase + const MongoDefaultHeartbeatInterval + const MongoDefaultMaxConnIdleTime + const MongoDefaultMaxPoolSize + const MongoDefaultMinPoolSize + const MongoDefaultPort + const MongoDefaultServerSelectionTimeout + const MongoDefaultSocketTimeout + const MySQLDefaultConnMaxIdleTime + const MySQLDefaultConnMaxLifeTime + const MySQLDefaultCreateBatchSize + const MySQLDefaultDatabase + const MySQLDefaultMaxIdleConns + const MySQLDefaultMaxOpenConns + const MySQLDefaultPort + type MongoOptions struct + ConnectTimeout time.Duration + Database string + HeartbeatInterval time.Duration + Host string + MaxConnIdleTime time.Duration + MaxPoolSize uint64 + MinPoolSize uint64 + Password string + Port string + ServerSelectionTimeout time.Duration + SocketTimeout time.Duration + Username string + func NewMongoOptions() *MongoOptions + func (o *MongoOptions) AddFlags(fs *pflag.FlagSet) + func (o *MongoOptions) Enabled() bool + func (o *MongoOptions) GetDBInstance(ctx context.Context) (*mongo.Client, *mongo.Database, error) + func (o *MongoOptions) Validate() error + type MySQLOptions struct + ConnMaxIdleTime time.Duration + ConnMaxLifetime time.Duration + CreateBatchSize int + Database string + Host string + MaxIdleConns int + MaxOpenConns int + Password string + Port string + Username string + func NewMySQLOptions() *MySQLOptions + func (o *MySQLOptions) AddFlags(fs *pflag.FlagSet) + func (o *MySQLOptions) Enabled() bool + func (o *MySQLOptions) GetGORMInstance(ctx context.Context) (*gorm.DB, error) + func (o *MySQLOptions) Validate() error + type Options struct + Mongo *MongoOptions + MySQL *MySQLOptions + SQLite3 *SQLite3Options + func NewOptions() *Options + func (o *Options) AddFlags(fs *pflag.FlagSet) + func (o *Options) Validate() error + type SQLite3Options struct + File string + func NewSQLite3Options() *SQLite3Options + func (o *SQLite3Options) AddFlags(fs *pflag.FlagSet) + func (o *SQLite3Options) Enabled() bool + func (o *SQLite3Options) GetGORMInstance(ctx context.Context) (*gorm.DB, error) + func (o *SQLite3Options) Validate() error