mysql

package
v0.0.0-...-6ebe9bd Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2021 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(cfg Config, logger *log.Logger) (repository.Store, error)

Types

type Config

type Config struct {
	Host         string
	Port         int `default:"3306"`
	DatabaseName string
	User         string
	Password     string
	LogMode      bool `default:"true"`
}

type Item

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

func (*Item) Create

func (m *Item) Create(item *domain.Item) error

func (*Item) Delete

func (m *Item) Delete(item *domain.Item) error

func (*Item) FindAll

func (m *Item) FindAll() ([]*domain.Item, error)

type Repository

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

func (*Repository) BeginTransaction

func (r *Repository) BeginTransaction() (repository.Store, error)

func (*Repository) Commit

func (r *Repository) Commit() error

func (*Repository) Item

func (r *Repository) Item() repository.Item

func (*Repository) Rollback

func (r *Repository) Rollback() error

func (*Repository) User

func (r *Repository) User() repository.User

type User

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

func (*User) Create

func (m *User) Create(user *domain.User) error

func (*User) FindAll

func (m *User) FindAll() ([]*domain.User, error)

func (*User) FindByEmail

func (m *User) FindByEmail(email string) (*domain.User, error)

func (*User) FindByID

func (m *User) FindByID(id domain.UUID) (*domain.User, error)

Jump to

Keyboard shortcuts

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