database

package
v0.0.0-...-7fa7ca5 Latest Latest
Warning

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

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

type Database struct {
	Ent   *ent.Client
	Redis *redis.Storage
	S3    *s3.Storage
}

func Init

func Init() *Database

func (*Database) MigrateModels

func (db *Database) MigrateModels() error

func (*Database) SeedModels

func (db *Database) SeedModels(logger zerolog.Logger, seeder ...Seeder)

func (*Database) SetupEnt

func (db *Database) SetupEnt(host string, port int, user string, password string, name string, logger ...zerolog.Logger) error

func (*Database) SetupRedis

func (db *Database) SetupRedis(url string, reset bool) error

func (*Database) SetupS3

func (db *Database) SetupS3(endpoint, bucket, region, accessKey, secretKey string) error

type Seeder

type Seeder interface {
	Seed() error
	Count() (int, error)
}

Directories

Path Synopsis
ent

Jump to

Keyboard shortcuts

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