mysql

package
v0.0.0-...-d91fea5 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2019 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDbMap

func NewDbMap() *gorp.DbMap

func ToDomainError

func ToDomainError(err error) error

Types

type Money

type Money struct {
	ID        int64     `db:"id, primarykey"`
	UserID    int64     `db:"user_id"`
	Amount    int64     `db:"amount"`
	UpdatedAt time.Time `db:"updated_at"`
}

type Transfer

type Transfer struct {
	ID int64 `db:"id, primarykey"`

	SrcUserID  string `db:"src_user_id"`
	DestUserID string `db:"dest_user_id"`

	Amount uint64 `db:"amount"`

	CreatedAt time.Time `db:"created_at"`
}

type User

type User struct {
	ID int64 `db:"id, primarykey, autoincrement"`

	Name string `db:"name"`
	Age  int    `db:"age"`

	CreatedAt time.Time `db:"created_at"`
	UpdatedAt time.Time `db:"updated_at"`
}

func (*User) ToDomain

func (u *User) ToDomain() *user.User

func (*User) ToDomainProfile

func (u *User) ToDomainProfile() *user.Profile

func (*User) WithProfile

func (u *User) WithProfile(profile *user.Profile, now time.Time) *User

Jump to

Keyboard shortcuts

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