Documentation ¶
Index ¶
- type Controller
- func (rc *Controller) Create(w http.ResponseWriter, r *http.Request) error
- func (rh *Controller) Delete(w http.ResponseWriter, r *http.Request) error
- func (rc *Controller) FindByID(w http.ResponseWriter, r *http.Request) error
- func (rc *Controller) List(w http.ResponseWriter, r *http.Request) error
- func (rc *Controller) Update(w http.ResponseWriter, r *http.Request) error
- type CreateRequest
- type KeyType
- type Repository
- type Round
- type Service
- type UpdateRequest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Controller ¶
type Controller struct {
// contains filtered or unexported fields
}
func NewController ¶
func NewController(rs Service) *Controller
func (*Controller) Create ¶
func (rc *Controller) Create(w http.ResponseWriter, r *http.Request) error
func (*Controller) Delete ¶
func (rh *Controller) Delete(w http.ResponseWriter, r *http.Request) error
func (*Controller) FindByID ¶
func (rc *Controller) FindByID(w http.ResponseWriter, r *http.Request) error
func (*Controller) List ¶
func (rc *Controller) List(w http.ResponseWriter, r *http.Request) error
func (*Controller) Update ¶
func (rc *Controller) Update(w http.ResponseWriter, r *http.Request) error
type CreateRequest ¶
type CreateRequest struct { GameId int64 `json:"gameId"` TestClassId string `json:"testClassId"` StartedAt *time.Time `json:"startedAt,omitempty"` ClosedAt *time.Time `json:"closedAt,omitempty"` }
func (CreateRequest) Validate ¶
func (CreateRequest) Validate() error
type Repository ¶
type Repository struct {
// contains filtered or unexported fields
}
func NewRepository ¶
func NewRepository(db *gorm.DB) *Repository
func (*Repository) Create ¶
func (rs *Repository) Create(r *CreateRequest) (Round, error)
func (*Repository) Delete ¶
func (rs *Repository) Delete(id int64) error
func (*Repository) FindByGame ¶
func (rs *Repository) FindByGame(id int64) ([]Round, error)
func (*Repository) Update ¶
func (rs *Repository) Update(id int64, r *UpdateRequest) (Round, error)
type UpdateRequest ¶
type UpdateRequest struct { StartedAt *time.Time `json:"startedAt,omitempty"` ClosedAt *time.Time `json:"closedAt,omitempty"` }
func (UpdateRequest) Validate ¶
func (UpdateRequest) Validate() error
Click to show internal directories.
Click to hide internal directories.