kiwimix/pkg/stackops/save.go
2023-06-20 23:44:50 +02:00

23 lines
436 B
Go

package stackops
import (
basetypes "code.apps.glenux.net/glenux/kiwimix/pkg/basetypes"
)
type SaveOperation struct {
filePath string
}
func NewSaveOperation(filePath string) *SaveOperation {
saveop := new(SaveOperation)
return saveop
}
func (op *SaveOperation) Execute(stack *basetypes.CalendarStack) error {
cal, err := basetypes.ParseCalendarFile(op.filePath)
if err != nil {
return err
}
stack.Push(cal)
return nil
}