models

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

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

Go to latest
Published: Jul 29, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DB

type DB interface {
	Connection() *gorm.DB
}

type Rate

type Rate struct {
	ID           uint   `gorm:"primaryKey"`
	CurrencyFrom string `gorm:"column:cc_from"`
	CurrencyTo   string `gorm:"column:cc_to"`
	Rate         float32
	Created      int64 `gorm:"autoCreateTime"` // Use unix seconds as creating time
}

func (Rate) String

func (r Rate) String() string

type RateRepository

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

func NewRateRepository

func NewRateRepository(db DB) *RateRepository

func (*RateRepository) Create

func (r *RateRepository) Create(rate *Rate) error

type User

type User struct {
	gorm.Model
	Email string `json:"email"`
}

func (User) String

func (u User) String() string

type UserRepository

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

func NewUserRepository

func NewUserRepository(db DB) *UserRepository

func (*UserRepository) Create

func (r *UserRepository) Create(user *User) error

func (*UserRepository) Exists

func (r *UserRepository) Exists(user *User) (bool, error)

func (*UserRepository) FindAll

func (r *UserRepository) FindAll() ([]User, error)

Jump to

Keyboard shortcuts

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