data

package
v0.0.0-...-a76f623 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2023 License: MIT Imports: 15 Imported by: 0

README

Data

Documentation

Index

Constants

View Source
const ConnName = "github.com/go-saas/kit-layout"

Variables

ProviderSet is data providers.

Functions

func GetDb

func GetDb(ctx context.Context, provider gorm.DbProvider) *g.DB

func NewPostRepo

func NewPostRepo(dbProvider sgorm.DbProvider, eventbus *eventbus.EventBus) biz.PostRepo

Types

type Data

type Data struct {
	DbProvider gorm.DbProvider
}

Data .

func NewData

func NewData(c *conf2.Data, dbProvider gorm.DbProvider, logger log.Logger) (*Data, func(), error)

NewData .

type Migrate

type Migrate struct {
	// contains filtered or unexported fields
}

func NewMigrate

func NewMigrate(data *Data) *Migrate

func (*Migrate) Seed

func (m *Migrate) Seed(ctx context.Context, sCtx *seed.Context) error

type PostRepo

type PostRepo struct {
	*kitgorm.Repo[biz.Post, string, v1.ListPostRequest]
}

func (*PostRepo) BuildDetailScope

func (c *PostRepo) BuildDetailScope(withDetail bool) func(db *gorm.DB) *gorm.DB

BuildDetailScope preload relations

func (*PostRepo) BuildFilterScope

func (c *PostRepo) BuildFilterScope(q *v1.ListPostRequest) func(db *gorm.DB) *gorm.DB

BuildFilterScope filter

func (*PostRepo) DefaultSorting

func (c *PostRepo) DefaultSorting() []string

func (*PostRepo) GetDb

func (c *PostRepo) GetDb(ctx context.Context) *gorm.DB

Jump to

Keyboard shortcuts

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