db

package
v0.0.0-...-0940e79 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DB

type DB struct {
	*bun.DB
	// contains filtered or unexported fields
}

func (*DB) Init

func (d *DB) Init(ctx context.Context) (*gobs.ServiceLifeCycle, error)

func (*DB) Setup

func (d *DB) Setup(ctx context.Context, deps ...gobs.IService) error

func (*DB) Start

func (d *DB) Start(ctx context.Context) error

func (*DB) Stop

func (d *DB) Stop(ctx context.Context) error

type DBConfig

type DBConfig struct {
	Uri      string `env:"DB_URI" mapstructure:"DB_URI" envDefault:""`
	Type     string `env:"DB_TYPE" mapstructure:"DB_TYPE" envDefault:"postgres"`
	Host     string `env:"DB_HOST" mapstructure:"DB_HOST" envDefault:"localhost"`
	Port     int    `env:"DB_PORT" mapstructure:"DB_PORT" envDefault:"5432"`
	DbName   string `env:"DB_NAME" mapstructure:"DB_NAME" envDefault:"postgres"`
	UserName string `env:"DB_USER" mapstructure:"DB_USER" envDefault:"postgres"`
	Password string `env:"DB_PASSWORD" mapstructure:"DB_PASSWORD" envDefault:"postgres"`
	SslMode  string `env:"DB_SSL_MODE" mapstructure:"DB_SSL_MODE" envDefault:"disable"`
}

Jump to

Keyboard shortcuts

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