repository

package
v0.0.0-...-68fba19 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Fruits

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

Fruits implements FruitsInterface.

func NewFruits

func NewFruits(engine xorm.EngineInterface) *Fruits

NewFruits initializes a fruits repository.

func (*Fruits) Create

func (f *Fruits) Create(body *model.FruitBody) (*model.Fruit, error)

Create adds a new fruit and returns the created item.

func (*Fruits) Delete

func (f *Fruits) Delete(fruitID uint64) error

Delete performs logical deletion by the given ID.

func (*Fruits) GetAll

func (f *Fruits) GetAll() ([]*model.Fruit, error)

GetAll gets all fruits.

func (*Fruits) GetByID

func (f *Fruits) GetByID(fruitID uint64) (*model.Fruit, error)

GetByID gets a fruit by the given ID.

func (*Fruits) Update

func (f *Fruits) Update(fruitID uint64, body *model.FruitBody) (*model.Fruit, error)

Update edits a fruit data by the given ID.

type FruitsInterface

type FruitsInterface interface {
	GetAll() ([]*model.Fruit, error)
	GetByID(fruitID uint64) (*model.Fruit, error)
	Create(body *model.FruitBody) (*model.Fruit, error)
	Update(fruitID uint64, body *model.FruitBody) (*model.Fruit, error)
	Delete(fruitID uint64) error
}

FruitsInterface is a fruits repository.

type Users

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

Users has users data.

func NewUsers

func NewUsers(engine infra.EngineInterface, kvsClient infra.KVSClientInterface) *Users

NewUsers initializes Users

func (*Users) Create

func (u *Users) Create(email string, profile *model.UserProfile) (*model.UserPublicData, error)

Create adds a new user.

func (*Users) Delete

func (u *Users) Delete(id uint64) error

Delete sets is_deleted = true

func (*Users) GetByEmail

func (u *Users) GetByEmail(email string) (user *model.User, ok bool)

GetByEmail returns an user who has the given email.

func (*Users) GetByID

func (u *Users) GetByID(id uint64) (user *model.User, ok bool)

GetByID はIDでユーザー情報を取得します

func (*Users) Update

func (u *Users) Update(id uint64, profile *model.UserProfile) (*model.UserPublicData, error)

Update updates user's profile data.

func (*Users) Verify

func (u *Users) Verify(userID uint64) error

Verify updates user as verified

type UsersInterface

type UsersInterface interface {
	GetByEmail(email string) (user *model.User, ok bool)
	GetByID(id uint64) (user *model.User, ok bool)
	Create(email string, profile *model.UserProfile) (*model.UserPublicData, error)
	Verify(userID uint64) error
	Update(id uint64, profile *model.UserProfile) (*model.UserPublicData, error)
	Delete(id uint64) error
}

UsersInterface has users data.

Jump to

Keyboard shortcuts

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