Documentation ¶
Index ¶
- Constants
- Variables
- func AddRoutes(router *router.Router, handler ActivityHandler)
- type ActivityHandler
- func (h *ActivityHandler) DeleteActivity(w http.ResponseWriter, r *http.Request)
- func (h *ActivityHandler) GetActivity(w http.ResponseWriter, r *http.Request)
- func (h *ActivityHandler) ListActiveActivities(w http.ResponseWriter, r *http.Request)
- func (h *ActivityHandler) ListActiveActivitiesJson(w http.ResponseWriter, r *http.Request)
- func (h *ActivityHandler) SaveActivity(w http.ResponseWriter, r *http.Request)
- func (h *ActivityHandler) ShowActivity(w http.ResponseWriter, r *http.Request)
- func (h *ActivityHandler) ShowCreateActivityForm(w http.ResponseWriter, r *http.Request)
- func (h *ActivityHandler) ShowEditActivityForm(w http.ResponseWriter, r *http.Request)
- func (h *ActivityHandler) UpdateActivity(w http.ResponseWriter, r *http.Request)
- type ActivityService
Constants ¶
View Source
const ApiRoute = config.ApiPrefix + ResourceUrl
View Source
const ResourceUrl string = "/activities"
Variables ¶
View Source
var ( ErrActivityNotFound = errors.New("activity not found") ErrUndefinedColumn = errors.New("column does not exist") )
Functions ¶
func AddRoutes ¶
func AddRoutes(router *router.Router, handler ActivityHandler)
Types ¶
type ActivityHandler ¶
type ActivityHandler struct {
// contains filtered or unexported fields
}
func NewActivityHandler ¶
func NewActivityHandler(as ActivityService, vs venue.VenueService, hs host.HostService, ds division.DivisionService) *ActivityHandler
func (*ActivityHandler) DeleteActivity ¶
func (h *ActivityHandler) DeleteActivity(w http.ResponseWriter, r *http.Request)
func (*ActivityHandler) GetActivity ¶
func (h *ActivityHandler) GetActivity(w http.ResponseWriter, r *http.Request)
func (*ActivityHandler) ListActiveActivities ¶
func (h *ActivityHandler) ListActiveActivities(w http.ResponseWriter, r *http.Request)
func (*ActivityHandler) ListActiveActivitiesJson ¶
func (h *ActivityHandler) ListActiveActivitiesJson(w http.ResponseWriter, r *http.Request)
func (*ActivityHandler) SaveActivity ¶
func (h *ActivityHandler) SaveActivity(w http.ResponseWriter, r *http.Request)
func (*ActivityHandler) ShowActivity ¶
func (h *ActivityHandler) ShowActivity(w http.ResponseWriter, r *http.Request)
func (*ActivityHandler) ShowCreateActivityForm ¶
func (h *ActivityHandler) ShowCreateActivityForm(w http.ResponseWriter, r *http.Request)
func (*ActivityHandler) ShowEditActivityForm ¶
func (h *ActivityHandler) ShowEditActivityForm(w http.ResponseWriter, r *http.Request)
func (*ActivityHandler) UpdateActivity ¶
func (h *ActivityHandler) UpdateActivity(w http.ResponseWriter, r *http.Request)
type ActivityService ¶
type ActivityService interface { CreateActivity(ctx context.Context, req db.CreateActivityParams) (*db.Activity, error) ListActivities(ctx context.Context, params *request.QueryParams) (*response.PaginatedData[db.ActiveActivityDetailWithCount], error) FindActiveActivity(ctx context.Context, id int64) error FindActiveActivityDetails(ctx context.Context, id int64) (*db.ActiveActivityDetail, error) UpdateActivity(ctx context.Context, params db.UpdateActivityParams) error DeleteActivity(ctx context.Context, id int64) error CountActiveActivities(ctx context.Context) (int64, error) }
func NewActivityService ¶
func NewActivityService(database *db.Database) ActivityService
Click to show internal directories.
Click to hide internal directories.