kiwimix/pkg/calendarops/boolean_union.go

25 lines
857 B
Go

package calendarops
import (
"errors"
basetypes "code.apps.glenux.net/glenux/kiwimix/pkg/basetypes"
)
// UnionCalendarOperation is an operation that merges two calendars into one.
type UnionCalendarOperation struct {
// Add your union parameters here
}
// Ensure UnionCalendarOperation implements CalendarOperation
var _ CalendarOperation = (*UnionCalendarOperation)(nil)
// Execute combines the events of two calendars and returns a new calendar that contains all events from both.
func (op *UnionCalendarOperation) Execute(calendars ...basetypes.Calendar) (basetypes.Calendar, error) {
if len(calendars) != 2 {
return basetypes.Calendar{}, errors.New("Union operation requires exactly two calendars")
}
// Do your union operation here and return the new union basetypes.
return calendars[0], nil // Replace this with actual implementation
}