data

package
v0.0.0-...-3a46aa3 Latest Latest
Warning

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

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

README

Data

Documentation

Index

Constants

This section is empty.

Variables

ProviderSet is data providers.

Functions

func NewCardRepo

func NewCardRepo(data *Data, logger log.Logger) biz.CardRepo

func NewMongo

func NewMongo(conf *conf.Data, logger log.Logger) *mongo.Client

func NewTransaction

func NewTransaction(d *Data) biz.Transaction

NewTransaction .

func NewUserRepo

func NewUserRepo(data *Data, logger log.Logger) biz.UserRepo

NewUserRepo .

Types

type Card

type Card struct {
	Id        primitive.ObjectID `bson:"_id"`
	UserID    int64              `bson:"userID"`
	Money     int64              `bson:"money"`
	CreatedAt time.Time          `bson:"createdAt"`
	UpdatedAt time.Time          `bson:"updatedAt"`
}

type Data

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

Data .

func NewData

func NewData(mongo *mongo.Client, logger log.Logger) (*Data, func(), error)

NewData .

func (*Data) ExecTx

func (d *Data) ExecTx(ctx context.Context, fn func(ctx context.Context) error) error

func (*Data) StartSession

func (d *Data) StartSession(ctx context.Context) (context.Context, func(context.Context), error)

type User

type User struct {
	Id        int64     `bson:"id"`
	Name      string    `bson:"name"`
	Email     string    `bson:"email"`
	CreatedAt time.Time `bson:"createdAt"`
	UpdatedAt time.Time `bson:"updatedAt"`
}

Jump to

Keyboard shortcuts

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