kiwimix/pkg/stackops/save.go

24 lines
428 B
Go
Raw Normal View History

2023-06-20 21:44:50 +00:00
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.Stack) error {
2023-06-20 21:44:50 +00:00
cal, err := basetypes.ParseCalendarFile(op.filePath)
if err != nil {
return err
}
stack.Push(cal)
return nil
}