21 lines
469 B
Go
21 lines
469 B
Go
package models
|
|
|
|
// Store represents the backing store.
|
|
type Store interface {
|
|
SelectActions() ([]*Action, error)
|
|
SelectActionByID(id int) (*Action, error)
|
|
SelectPlans() ([]*Plan, error)
|
|
SelectPlanByID(id int) (*Plan, error)
|
|
InsertPlan(plan *Plan) (int, error)
|
|
}
|
|
|
|
// Model represents a current model item.
|
|
type Model struct {
|
|
Store
|
|
}
|
|
|
|
// New creates an instance of the model using the passed in store.
|
|
func New(store Store) *Model {
|
|
return &Model{Store: store}
|
|
}
|