Documentation ¶
Overview ¶
Package note provides access to the note table in the database.
Index ¶
- type Connection
- type Item
- type Service
- func (s Service) ByID(ID string, userID string) (Item, bool, error)
- func (s Service) ByUserID(userID string) ([]Item, bool, error)
- func (s Service) Create(name string, userID string) (sql.Result, error)
- func (s Service) DeleteHard(ID string, userID string) (sql.Result, error)
- func (s Service) DeleteSoft(ID string, userID string) (sql.Result, error)
- func (s Service) Update(name string, ID string, userID string) (sql.Result, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Connection ¶
type Connection interface { Exec(query string, args ...interface{}) (sql.Result, error) Get(dest interface{}, query string, args ...interface{}) error Select(dest interface{}, query string, args ...interface{}) error }
Connection is an interface for making queries.
type Item ¶
type Item struct { ID uint32 `db:"id"` Name string `db:"name"` UserID uint32 `db:"user_id"` CreatedAt null.Time `db:"created_at"` UpdatedAt null.Time `db:"updated_at"` DeletedAt null.Time `db:"deleted_at"` }
Item defines the model.
type Service ¶
type Service struct {
DB Connection
}
Service defines the database connection.
func (Service) DeleteHard ¶
DeleteHard removes an item.
func (Service) DeleteSoft ¶
DeleteSoft marks an item as removed.
Click to show internal directories.
Click to hide internal directories.