Documentation ¶
Index ¶
- type Board
- type BoardDBManager
- func (*BoardDBManager) Create(tx usecase.Transaction, board model.Board) error
- func (*BoardDBManager) Delete(tx usecase.Transaction, board model.Board) error
- func (*BoardDBManager) Find(tx usecase.Transaction, conditions map[string]interface{}) (model.Boards, error)
- func (*BoardDBManager) FindByID(tx usecase.Transaction, id, userID string) (model.Board, error)
- func (*BoardDBManager) Update(tx usecase.Transaction, board model.Board, updates map[string]interface{}) error
- type Boards
- type DBManager
- type Item
- type ItemDBManager
- func (*ItemDBManager) Create(tx usecase.Transaction, item model.Item) error
- func (*ItemDBManager) Delete(tx usecase.Transaction, item model.Item) error
- func (*ItemDBManager) Find(tx usecase.Transaction, conditions map[string]interface{}) (model.Items, error)
- func (*ItemDBManager) FindByID(tx usecase.Transaction, id, userID string) (model.Item, error)
- func (*ItemDBManager) Update(tx usecase.Transaction, item model.Item, updates map[string]interface{}) error
- type Items
- type List
- type ListDBManager
- func (*ListDBManager) Create(tx usecase.Transaction, list model.List) error
- func (*ListDBManager) Delete(tx usecase.Transaction, list model.List) error
- func (*ListDBManager) Find(tx usecase.Transaction, conditions map[string]interface{}) (model.Lists, error)
- func (*ListDBManager) FindByID(tx usecase.Transaction, id, userID string) (model.List, error)
- func (*ListDBManager) Update(tx usecase.Transaction, list model.List, updates map[string]interface{}) error
- type Lists
- type Tag
- type TagDBManager
- type Tags
- type Transaction
- type TransactionManager
- type User
- type UserDBManager
- type Users
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Board ¶
type Board struct { ID string `gorm:"primary_key"` UserID string `gorm:"primary_key"` Title string Text *string Color string Before *string After *string CreatedAt time.Time UpdatedAt time.Time DeletedAt *time.Time }
Board is Board data model for DB.
type BoardDBManager ¶
type BoardDBManager struct{}
BoardDBManager is DB manager for Board.
func (*BoardDBManager) Create ¶
func (*BoardDBManager) Create(tx usecase.Transaction, board model.Board) error
Create registers a Board to DB.
func (*BoardDBManager) Delete ¶
func (*BoardDBManager) Delete(tx usecase.Transaction, board model.Board) error
Delete removes a Board from DB.
func (*BoardDBManager) Find ¶
func (*BoardDBManager) Find(tx usecase.Transaction, conditions map[string]interface{}) (model.Boards, error)
Find gets Boards.
func (*BoardDBManager) FindByID ¶
func (*BoardDBManager) FindByID(tx usecase.Transaction, id, userID string) (model.Board, error)
FindByID gets a Board had specific ID from DB.
func (*BoardDBManager) Update ¶
func (*BoardDBManager) Update(tx usecase.Transaction, board model.Board, updates map[string]interface{}) error
Update updates all fields of specific Board in DB.
type DBManager ¶
type DBManager struct { TransactionManager TransactionManager ItemDBManager ItemDBManager ListDBManager ListDBManager BoardDBManager BoardDBManager UserDBManager UserDBManager TagDBManager TagDBManager }
DBManager includes DB managers for all data model.
type Item ¶
type Item struct { ID string `gorm:"primary_key"` UserID string `gorm:"primary_key"` ListID string Title string Text *string Tags *string Before *string After *string CreatedAt time.Time UpdatedAt time.Time DeletedAt *time.Time }
Item is Item data model for DB.
type ItemDBManager ¶
type ItemDBManager struct{}
ItemDBManager is DB manager for Item.
func (*ItemDBManager) Create ¶
func (*ItemDBManager) Create(tx usecase.Transaction, item model.Item) error
Create registers a Item to DB.
func (*ItemDBManager) Delete ¶
func (*ItemDBManager) Delete(tx usecase.Transaction, item model.Item) error
Delete removes a Item from DB.
func (*ItemDBManager) Find ¶
func (*ItemDBManager) Find(tx usecase.Transaction, conditions map[string]interface{}) (model.Items, error)
Find gets Items.
func (*ItemDBManager) FindByID ¶
func (*ItemDBManager) FindByID(tx usecase.Transaction, id, userID string) (model.Item, error)
FindByID gets a Item had specific ID from DB.
func (*ItemDBManager) Update ¶
func (*ItemDBManager) Update(tx usecase.Transaction, item model.Item, updates map[string]interface{}) error
Update updates all fields of specific Item in DB.
type List ¶
type List struct { ID string `gorm:"primary_key"` UserID string `gorm:"primary_key"` BoardID string Title string Before *string After *string CreatedAt time.Time UpdatedAt time.Time DeletedAt *time.Time }
List is List data model for DB.
type ListDBManager ¶
type ListDBManager struct{}
ListDBManager is DB manager for List.
func (*ListDBManager) Create ¶
func (*ListDBManager) Create(tx usecase.Transaction, list model.List) error
Create registers a List to DB.
func (*ListDBManager) Delete ¶
func (*ListDBManager) Delete(tx usecase.Transaction, list model.List) error
Delete removes a List from DB.
func (*ListDBManager) Find ¶
func (*ListDBManager) Find(tx usecase.Transaction, conditions map[string]interface{}) (model.Lists, error)
Find gets Lists.
func (*ListDBManager) FindByID ¶
func (*ListDBManager) FindByID(tx usecase.Transaction, id, userID string) (model.List, error)
FindByID gets a List had specific ID from DB.
func (*ListDBManager) Update ¶
func (*ListDBManager) Update(tx usecase.Transaction, list model.List, updates map[string]interface{}) error
Update updates all fields of specific List in DB.
type Tag ¶
type Tag struct { ID string `gorm:"primary_key"` Name string Color string CreatedAt time.Time UpdatedAt time.Time DeletedAt *time.Time }
Tag is Tag data model for DB.
type TagDBManager ¶
type TagDBManager struct{}
TagDBManager is DB manager for Tag.
func (*TagDBManager) Create ¶
func (*TagDBManager) Create(tx usecase.Transaction, tag model.Tag) error
Create registers a Tag to DB.
func (*TagDBManager) Find ¶
func (*TagDBManager) Find(tx usecase.Transaction, conditions map[string]interface{}) (model.Tags, error)
Find get Tags.
type Transaction ¶
type Transaction struct {
// contains filtered or unexported fields
}
func (*Transaction) Commit ¶
func (tx *Transaction) Commit()
func (*Transaction) DB ¶
func (tx *Transaction) DB() interface{}
func (*Transaction) Rollback ¶
func (tx *Transaction) Rollback()
type TransactionManager ¶
type TransactionManager struct {
// contains filtered or unexported fields
}
TransactionManager is DB transaction manager.
func (*TransactionManager) BeginTransaction ¶
func (m *TransactionManager) BeginTransaction(on bool) usecase.Transaction
type User ¶
type User struct { ID string `gorm:"primary_key"` Name string // Password is raw. It should be hash. Password string CreatedAt time.Time UpdatedAt time.Time DeletedAt *time.Time }
User is User data model for DB.
type UserDBManager ¶
type UserDBManager struct{}
UserDBManager is DB manager for User.
func (*UserDBManager) Create ¶
func (*UserDBManager) Create(tx usecase.Transaction, user model.User) error
Create registers a User to DB.
func (*UserDBManager) Find ¶
func (*UserDBManager) Find(tx usecase.Transaction, conditions map[string]interface{}) (model.User, error)
Find gets a User.