activity

package
v0.0.0-...-7f4fd67 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 4, 2024 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

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 (*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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL