Initial commit: Open sourcing all of the Maple Open Technologies code.
This commit is contained in:
commit
755d54a99d
2010 changed files with 448675 additions and 0 deletions
19
native/desktop/maplefile/internal/usecase/syncstate/get.go
Normal file
19
native/desktop/maplefile/internal/usecase/syncstate/get.go
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
package syncstate
|
||||
|
||||
import (
|
||||
"codeberg.org/mapleopentech/monorepo/native/desktop/maplefile/internal/domain/syncstate"
|
||||
)
|
||||
|
||||
type GetUseCase struct {
|
||||
syncStateRepo syncstate.Repository
|
||||
}
|
||||
|
||||
// ProvideGetUseCase creates the use case for Wire
|
||||
func ProvideGetUseCase(syncStateRepo syncstate.Repository) *GetUseCase {
|
||||
return &GetUseCase{syncStateRepo: syncStateRepo}
|
||||
}
|
||||
|
||||
// Execute retrieves the current sync state
|
||||
func (uc *GetUseCase) Execute() (*syncstate.SyncState, error) {
|
||||
return uc.syncStateRepo.Get()
|
||||
}
|
||||
19
native/desktop/maplefile/internal/usecase/syncstate/reset.go
Normal file
19
native/desktop/maplefile/internal/usecase/syncstate/reset.go
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
package syncstate
|
||||
|
||||
import (
|
||||
"codeberg.org/mapleopentech/monorepo/native/desktop/maplefile/internal/domain/syncstate"
|
||||
)
|
||||
|
||||
type ResetUseCase struct {
|
||||
syncStateRepo syncstate.Repository
|
||||
}
|
||||
|
||||
// ProvideResetUseCase creates the use case for Wire
|
||||
func ProvideResetUseCase(syncStateRepo syncstate.Repository) *ResetUseCase {
|
||||
return &ResetUseCase{syncStateRepo: syncStateRepo}
|
||||
}
|
||||
|
||||
// Execute resets the sync state for a fresh sync
|
||||
func (uc *ResetUseCase) Execute() error {
|
||||
return uc.syncStateRepo.Reset()
|
||||
}
|
||||
19
native/desktop/maplefile/internal/usecase/syncstate/save.go
Normal file
19
native/desktop/maplefile/internal/usecase/syncstate/save.go
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
package syncstate
|
||||
|
||||
import (
|
||||
"codeberg.org/mapleopentech/monorepo/native/desktop/maplefile/internal/domain/syncstate"
|
||||
)
|
||||
|
||||
type SaveUseCase struct {
|
||||
syncStateRepo syncstate.Repository
|
||||
}
|
||||
|
||||
// ProvideSaveUseCase creates the use case for Wire
|
||||
func ProvideSaveUseCase(syncStateRepo syncstate.Repository) *SaveUseCase {
|
||||
return &SaveUseCase{syncStateRepo: syncStateRepo}
|
||||
}
|
||||
|
||||
// Execute saves the sync state
|
||||
func (uc *SaveUseCase) Execute(state *syncstate.SyncState) error {
|
||||
return uc.syncStateRepo.Save(state)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue