kiwimix/pkg/calendarops/filter.go

25 lines
824 B
Go
Raw Permalink Normal View History

2023-06-20 21:44:50 +00:00
package calendarops
import (
"errors"
basetypes "code.apps.glenux.net/glenux/kiwimix/pkg/basetypes"
)
// FilterCalendarOperation is an operation that filters a calendar.
type FilterCalendarOperation struct {
// Add your filter parameters here
}
// Ensure FilterCalendarOperation implements CalendarOperation
var _ CalendarOperation = (*FilterCalendarOperation)(nil)
// Execute filters the events of a calendar and returns a new filtered calendar.
func (op *FilterCalendarOperation) Execute(calendars ...*basetypes.Calendar) (*basetypes.Calendar, error) {
2023-06-20 21:44:50 +00:00
if len(calendars) != 1 {
return &basetypes.Calendar{}, errors.New("Filter operation requires exactly one calendar")
2023-06-20 21:44:50 +00:00
}
// Do your filter operation here and return the filtered calendar.
return calendars[0], nil // Replace this with actual implementation
}