repositories

package
v0.0.0-...-32e545c Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CacheConfig

type CacheConfig struct {
	DriverName string `json:"driver_name" yaml:"driver_name"`
	Host       string `json:"host" yaml:"host"`
	Port       int    `json:"port" yaml:"port"`
	Username   string `json:"username" yaml:"username"`
	Password   string `json:"password" yaml:"password"`
	DB         int    `json:"db" yaml:"db"`
}

type Config

type Config struct {
	DB        *DbConfig    `json:"db" yaml:"db"`
	ReplicaDB *DbConfig    `json:"replica_db" yaml:"replica_db"`
	Cache     *CacheConfig `json:"cache" yaml:"cache"`
}

type DbConfig

type DbConfig struct {
	DriverName string  `json:"driver_name" yaml:"driver_name" env:"DB_DRIVER_NAME" env-default:"postgres"`
	DB         *sql.DB `validate:"required_without=DbHost"`
	Host       string  `` /* 220-byte string literal not displayed */
	Port       int     `` /* 211-byte string literal not displayed */
	Name       string  `` /* 207-byte string literal not displayed */
	Username   string  `` /* 215-byte string literal not displayed */
	Password   string  `` /* 215-byte string literal not displayed */
	SslMode    bool    `` /* 215-byte string literal not displayed */
}

type Repository

type Repository interface {
	Cache() cache.Cache
	DB() db.DB
}

func New

func New(ctx context.Context, cfg *Config) (Repository, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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