database

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2022 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 Database

type Database struct {
	Ent *ent.Client
	Log zerolog.Logger
	Cfg *config.Config
}

func NewDatabase

func NewDatabase(cfg *config.Config, log zerolog.Logger) *Database

func (*Database) ConnectDatabase

func (db *Database) ConnectDatabase()

func (*Database) MigrateModels

func (db *Database) MigrateModels()

func (*Database) SeedModels

func (db *Database) SeedModels(seeder ...Seeder)

func (*Database) ShutdownDatabase

func (db *Database) ShutdownDatabase()

type Seeder

type Seeder interface {
	Seed(*ent.Client) error
	Count() (int, error)
}

Jump to

Keyboard shortcuts

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