repository

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	DBConfig
}

func (Config) MySQL

func (c Config) MySQL() *mysql.Config

type DBConfig

type DBConfig struct {
	DBHost                      string `default:"localhost" envconfig:"DB_HOST"`
	DBUser                      string `default:"root" envconfig:"DB_USER"`
	DBPassword                  string `default:"" envconfig:"DB_PASSWORD"`
	DBName                      string `envconfig:"DB_NAME"`
	DBLocation                  string `default:"Local" envconfig:"DB_LOCATION"`
	DBEnableTLS                 bool   `default:"false" envconfig:"DB_ENABLE_TLS"`
	DBCaCertPEM                 string `default:"/tmp/mysql-ca-cert.pem" envconfig:"DB_CA_CERT_PEM"`
	DBCustomTLSKey              string `default:"custom" envconfig:"DB_CUSTOM_TLS_KEY"`
	DBConnPoolSize              int    `default:"5" envconfig:"DB_CONN_POOL_SIZE"`
	DBLogLevel                  string `default:"info" envconfig:"DB_LOG_LEVEL"`
	DBSlowThresholdMS           int    `default:"100" envconfig:"DB_SLOW_THRESHOLD_MS"`
	DBDefaultPageSize           int    `default:"10" envconfig:"DB_DEFAULT_PAGE_SIZE"`
	DBIgnoreRecordNotFoundError bool   `default:"false" envconfig:"DB_IGNORE_RECORD_NOT_FOUND_ERROR"`
}

type Repository

type Repository interface {
	Init(*Config, logger.Logger) (Repository, error)

	ToCtx(context.Context, interface{}) context.Context
	Ctx(context.Context) Repository
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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